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