wok-next view dolibarr/receipt @ rev 21020
Cleaning is almost finished... I should proceed to upgrades.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 02 14:15:08 2018 +0200 (2018-11-02) |
parents | a3c581bf52b8 |
children | 0cbe4b1f2230 |
line source
1 # SliTaz package receipt.
3 PACKAGE="dolibarr"
4 VERSION="3.1.0"
5 CATEGORY="office"
6 SHORT_DESC="ERP/CRM"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="LGPL2"
9 WEB_SITE="https://www.dolibarr.fr/"
11 TARBALL="$PACKAGE-$VERSION.tgz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
15 compile_rules() {
16 # Fix attributes and perms
17 chown -R root.root *
18 chmod -x C* I* R*
19 find . \( -name "*.php" \
20 -o -name "*.png" \
21 -o -name "*.jpg" \
22 -o -name "*.gif" \
23 -o -name "*.txt" \
24 -o -name "*.ico" \
25 -o -name "*.html" \) -exec chmod -x {} \;
26 }
28 genpkg_rules() {
29 mkdir -p $fs/etc/dolibarr \
30 $fs/usr/share/dolibarr \
31 $fs/var/lib/dolibarr/documents \
32 $fs/usr/share/doc/$PACKAGE/schemas \
33 $fs/usr/share/applications
35 cp -a $src/htdocs $fs/usr/share/dolibarr
36 cp -a $src/scripts $fs/usr/share/dolibarr
38 # Remove install directory
39 #rm -rf $fs/usr/share/dolibarr/htdocs/install
41 # Populate documents directory
42 for dir in facture users propale mycompany ficheinter produit rapport; do
43 mkdir $fs/var/lib/dolibarr/documents/$dir
44 done
46 # Fix perms
47 chown -R root.www $fs/var/lib/dolibarr/documents
48 chmod -R 770 $fs/var/lib/dolibarr/documents
50 cp $stuff/conf.php $fs/etc/dolibarr
51 cp $stuff/$PACKAGE-$VERSION-mysql.sql $fs/usr/share/doc/$PACKAGE/schemas
52 cp -a $stuff/pixmaps $fs/usr/share/
54 ln -s /etc/dolibarr/conf.php $fs/usr/share/dolibarr/htdocs/conf
55 DEPENDS="apache php-apache php-gd php-mysqli"
56 }
58 post_install(){
60 db_name=dolibarr
61 db_user=dolibarr
62 db_password=dolibarr
64 # Configure apache server
65 if [ -f "$1/etc/apache/httpd.conf" ]; then
66 if [ ! -f "$1/etc/apache/conf.d/dolibarr.conf" ]; then
67 cat > "$1/etc/apache/conf.d/dolibarr.conf" <<EOT
68 <IfModule mod_alias.c>
69 Alias /dolibarr /usr/share/dolibarr/htdocs
70 </IfModule>
71 <Directory "/usr/share/dolibarr/htdocs">
72 Options Indexes FollowSymLinks
73 AllowOverride None
74 Order deny,allow
75 Allow from all
76 </Directory>
78 EOT
79 if [ -z "$1" ]; then
80 # Start Web server.
81 test -f /var/run/apache/httpd.pid &&
82 ( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart )
83 fi
84 fi
85 fi
87 # Configure every thing.
88 if [ -z "$1" ]; then
89 if ( ! mysqladmin -s ping > /dev/null ); then
90 echo "Starting MySQL server"
91 ( /etc/init.d/mysql start; status ) || exit
92 sleep 4 # let the mysql daemon start
93 fi
94 if ( ! mysql -u root -Be 'show databases' | grep -q $db_name ); then
95 action "Create $db_name database"
96 mysql -Be "create database $db_name"
97 status
99 # We suppose that databse user does not exist.
100 # It may be false.
101 action "Create user $db_user with password $db_password"
102 mysql -Be "grant all privileges on ${db_name}.* to '$db_user'@'localhost'
103 identified by '$db_password'"
104 status
106 # At last populate the database.
107 action "Create $db_name database schema."
108 mysql -u $db_user -p${db_password} -D $db_name < /usr/share/doc/dolibarr/schemas/$PACKAGE-$VERSION-mysql.sql
109 status
110 fi
111 fi
112 }