Enhance packager
This commit is contained in:
parent
bbf7242c0f
commit
62d4e246a7
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Debian install package run: config, preinst, prerm, postinst, postrm
|
||||
#
|
||||
# dpkg -l list all packages
|
||||
# dpkg -b is to build package
|
||||
# dpkg -c package.deb list content of package
|
||||
# dpkg -I package.deb give informations on package
|
||||
|
||||
@ -7,7 +7,7 @@ Package: dolibarr
|
||||
Section: web
|
||||
Architecture: all
|
||||
Essential: no
|
||||
Depends: wwwconfig-common, apache2, httpd, libapache2-mod-php5, php5, php5-cgi, php5-curl, php5-gd, php5-imagick, php5-ldap, php5-mcrypt, php5-mysql, perl
|
||||
Depends: wwwconfig-common, apache2, httpd, libapache2-mod-php5, php5, php5-cgi, php5-curl, php5-gd, php5-imagick, php5-ldap, php5-mcrypt, php5-mysql, mysql-server, perl
|
||||
Recommends: mozilla | netscape
|
||||
Installed-Size: 30000000
|
||||
Homepage: http://www.dolibarr.org
|
||||
|
||||
@ -51,7 +51,7 @@ case "$1" in
|
||||
#db_reset "dolibarr/webserver"
|
||||
|
||||
# Get the web server type.
|
||||
db_get "dolibarr/webserver" # Ask/read value for webserver.
|
||||
db_get "dolibarr/webserver" # Read value for webserver.
|
||||
# webserver="$RET"
|
||||
webserver="Both"
|
||||
case $webserver in
|
||||
@ -78,7 +78,6 @@ case "$1" in
|
||||
#
|
||||
chown -R $webuser.$webgroup /usr/share/dolibarr
|
||||
|
||||
# TODO This add alias into http.conf but it should go into apache2.conf
|
||||
includefile="/etc/dolibarr/apache.conf"
|
||||
#echo "$includefile $server"
|
||||
. /usr/share/wwwconfig-common/apache-include_all.sh
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
#
|
||||
# This script is not used. The script used to build the root
|
||||
# for making Debian pakcage is build/makepack-dolibarr.pl
|
||||
#
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
@ -238,10 +238,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/index.php`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
|
||||
}
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
@ -323,10 +322,7 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
$BUILDFIC="$FILENAME.spec";
|
||||
print "Copy $SOURCE/build/rpm/${BUILDFIC} to $BUILDROOT\n";
|
||||
# $ret=`cp -p "$SOURCE/build/rpm/${BUILDFIC}" "$BUILDROOT"`;
|
||||
|
||||
print "Edit version in file $BUILDROOT/$BUILDFIC\n";
|
||||
print "Generate file $BUILDROOT/$BUILDFIC\n";
|
||||
open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFIC}") || die "Error";
|
||||
open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error";
|
||||
while (<SPECFROM>) {
|
||||
@ -346,6 +342,9 @@ if ($nboftargetok) {
|
||||
}
|
||||
|
||||
if ($target eq 'DEB') {
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
|
||||
print "Move $BUILDROOT/$PROJECT $BUILDROOT/$PROJECT.tmp\n";
|
||||
$cmd="mv \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
|
||||
$ret=`$cmd`;
|
||||
@ -362,10 +361,9 @@ if ($nboftargetok) {
|
||||
print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT/DEBIAN\n";
|
||||
$ret=`cp -r "$SOURCE/build/deb/." "$BUILDROOT/$PROJECT/DEBIAN"`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/DEBIAN/CVS`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`;
|
||||
|
||||
print "Remove config file\n";
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`;
|
||||
print "Reset config file\n";
|
||||
$ret=`> $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`;
|
||||
|
||||
print "Edit version in file $BUILDROOT/$PROJECT/DEBIAN/control\n";
|
||||
open (SPECFROM,"<$SOURCE/build/deb/control") || die "Error";
|
||||
@ -381,8 +379,11 @@ if ($nboftargetok) {
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
|
||||
print "Create directory $BUILDROOT/$PROJECT/etc/dolibarr\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/dolibarr"`;
|
||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`;
|
||||
|
||||
print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||
|
||||
#print "Copy changelog file into $BUILDROOT/$PROJECT/DEBIAN\n";
|
||||
#$ret=`cp "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT/DEBIAN/changelog"`;
|
||||
@ -393,8 +394,17 @@ if ($nboftargetok) {
|
||||
print "Copy copyright file into $BUILDROOT/$PROJECT/DEBIAN\n";
|
||||
$ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT/DEBIAN/copyright"`;
|
||||
|
||||
print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/dolibarr\n";
|
||||
$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/dolibarr"`;
|
||||
print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||
$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||
|
||||
print "Set permissions/owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$PROJECT`;
|
||||
$ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`;
|
||||
$ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`;
|
||||
$ret=`chmod -R 555 $BUILDROOT/$PROJECT`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`;
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user