wok annotate dolibarr/receipt @ rev 23030

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