mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-27 16:27:19 +08:00
Added basic script for creating a Debian-style package.
This commit is contained in:
parent
509f81d2c8
commit
df29eb85cd
1 changed files with 70 additions and 0 deletions
70
makedeb.sh
Executable file
70
makedeb.sh
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
#Build RainLoop Webmail Debian Package
|
||||
PACKAGEVERSION="0";
|
||||
|
||||
#Build rainloop
|
||||
gulp build;
|
||||
cd build/dist/releases/webmail;
|
||||
cd $(ls -t); #Most recent build folder
|
||||
|
||||
#Working directory
|
||||
mkdir rainloop-deb-build;
|
||||
cd rainloop-deb-build;
|
||||
|
||||
#Prepare zip file
|
||||
unzip ../rainloop-community-latest.zip;
|
||||
find . -type d -exec chmod 755 {} \;
|
||||
find . -type f -exec chmod 644 {} \;
|
||||
|
||||
#Set up package directory
|
||||
VERSION=$(cat data/VERSION);
|
||||
DIR="rainloop_$VERSION-$PACKAGEVERSION";
|
||||
mkdir -m 0755 -p $DIR;
|
||||
mkdir -m 0755 -p $DIR/usr;
|
||||
mkdir -m 0755 -p $DIR/usr/share;
|
||||
mkdir -m 0755 -p $DIR/usr/share/rainloop;
|
||||
mkdir -m 0755 -p $DIR/var;
|
||||
mkdir -m 0755 -p $DIR/var/lib;
|
||||
|
||||
#Move files into package directory
|
||||
mv rainloop $DIR/usr/share/rainloop/rainloop;
|
||||
mv index.php $DIR/usr/share/rainloop/index.php;
|
||||
mv data $DIR/var/lib/rainloop;
|
||||
|
||||
#Update settings for Debian package
|
||||
sed -i "s/\$sCustomDataPath = '';/\$sCustomDataPath = '\/var\/lib\/rainloop';/" $DIR/usr/share/rainloop/rainloop/v/$VERSION/include.php
|
||||
sed -i "s/\$sCustomDataPath = \(.*\) : '';/\$sCustomDataPath = \1 : \$sCustomDataPath;/" $DIR/usr/share/rainloop/rainloop/v/$VERSION/include.php
|
||||
|
||||
#Set up Debian packaging tools
|
||||
cd $DIR;
|
||||
mkdir -m 0755 DEBIAN;
|
||||
|
||||
#Create Debian packging control file
|
||||
cat >> DEBIAN/control <<-EOF
|
||||
Package: rainloop
|
||||
Version: $VERSION
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends: php5-fpm (>= 5.4), php5-curl, php5-json
|
||||
Maintainer: Rainloop <support@rainloop.net>
|
||||
Installed-Size: 20330
|
||||
Description: Rainloop Webmail
|
||||
A modern PHP webmail client.
|
||||
EOF
|
||||
|
||||
#Create Debian packaging post-install script
|
||||
cat >> DEBIAN/postinst <<-EOF
|
||||
#!/bin/sh
|
||||
chown -R www-data:www-data /var/lib/rainloop
|
||||
EOF
|
||||
chmod +x DEBIAN/postinst;
|
||||
|
||||
#Build Debian package
|
||||
cd ..;
|
||||
fakeroot dpkg-deb -b $DIR;
|
||||
|
||||
#Clean up
|
||||
mv $DIR.deb ..;
|
||||
cd ..;
|
||||
rm -rf rainloop-deb-build;
|
Loading…
Reference in a new issue