wok-current view dolibarr/receipt @ rev 22737
updated dolibarr (9.0.0 -> 10.0.6)
author | Hans-G?nter Theisgen |
---|---|
date | Fri Jan 24 07:09:03 2020 +0100 (2020-01-24) |
parents | 0fd626c66eed |
children | 261355c410d6 |
line source
1 # SliTaz package receipt.
3 PACKAGE="dolibarr"
4 VERSION="10.0.6"
5 CATEGORY="office"
6 SHORT_DESC="ERP/CRM for small and medium companies."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPLv3"
9 WEB_SITE="https://www.dolibarr.org/"
11 TARBALL="$PACKAGE-$VERSION.tgz"
12 WGET_URL="https://sourceforge.net/projects/$PACKAGE/files/Dolibarr%20ERP-CRM/$VERSION/$TARBALL"
14 DEPENDS="apache php-apache php-gd php-mysqli"
15 BUILD_DEPENDS=""
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 # Fix attributes and permissions
21 chown -R root.root *
22 chmod -x C* I* R*
23 find . \( -name "*.php" \
24 -o -name "*.png" \
25 -o -name "*.jpg" \
26 -o -name "*.gif" \
27 -o -name "*.txt" \
28 -o -name "*.ico" \
29 -o -name "*.html" \) -exec chmod -x {} \;
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/etc/dolibarr
36 mkdir -p $fs/usr/share/dolibarr
37 mkdir -p $fs/var/lib/dolibarr/documents
38 mkdir -p $fs/usr/share/doc/$PACKAGE/schemas
39 mkdir -p $fs/usr/share/applications
41 cp -a $src/htdocs $fs/usr/share/dolibarr
42 cp -a $src/scripts $fs/usr/share/dolibarr
44 # Remove install directory
45 #rm -rf $fs/usr/share/dolibarr/htdocs/install
47 # Populate documents directory
48 for dir in facture users propale mycompany ficheinter produit rapport
49 do
50 mkdir $fs/var/lib/dolibarr/documents/$dir
51 done
53 # Fix permissions
54 chown -R root.www $fs/var/lib/dolibarr/documents
55 chmod -R 770 $fs/var/lib/dolibarr/documents
57 cp $stuff/conf.php $fs/etc/dolibarr
58 cp $stuff/$PACKAGE-$VERSION-mysql.sql \
59 $fs/usr/share/doc/$PACKAGE/schemas
60 cp -a $stuff/pixmaps $fs/usr/share/
62 ln -s /etc/dolibarr/conf.php $fs/usr/share/dolibarr/htdocs/conf
63 }
65 post_install(){
66 db_name=dolibarr
67 db_user=dolibarr
68 db_password=dolibarr
70 # Configure apache server
71 if [ -f "$1/etc/apache/httpd.conf" ]
72 then
73 if [ ! -f "$1/etc/apache/conf.d/dolibarr.conf" ]
74 then
75 cat > "$1/etc/apache/conf.d/dolibarr.conf" <<EOT
76 <IfModule mod_alias.c>
77 Alias /dolibarr /usr/share/dolibarr/htdocs
78 </IfModule>
79 <Directory "/usr/share/dolibarr/htdocs">
80 Options Indexes FollowSymLinks
81 AllowOverride None
82 Order deny,allow
83 Allow from all
84 </Directory>
86 EOT
87 if [ -z "$1" ]
88 then
89 # Start Web server.
90 test -f /var/run/apache/httpd.pid &&
91 ( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart )
92 fi
93 fi
94 fi
96 # Configure everything.
97 if [ -z "$1" ]
98 then
99 if ( ! mysqladmin -s ping > /dev/null )
100 then
101 echo "Starting MySQL server"
102 ( /etc/init.d/mysql start ; status ) || exit
103 sleep 4 #let the mysql daemon start
104 fi
105 if ( ! mysql -u root -Be 'show databases' | grep -q $db_name )
106 then
107 echo -n "Create $db_name database"
108 mysql -Be "create database $db_name"
109 status
111 # We suppose that databse user does not exist.
112 # It may be false.
113 echo -n "Create user $db_user with password $db_password"
114 mysql -Be "grant all privileges on ${db_name}.* to '$db_user'@'localhost'
115 identified by '$db_password'"
116 status
118 # At last populate the database.
119 echo -n "Create $db_name database schema."
120 mysql -u $db_user -p${db_password} -D $db_name < /usr/share/doc/dolibarr/schemas/$PACKAGE-$VERSION-mysql.sql
121 status
122 fi
123 fi
124 }