upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / backuppc / trunk / PKGBUILD
blob6387e68d0323b1a41143640b475f4dfd3fef846f
1 # Maintainer: Sébastien Luttringer
3 pkgname=backuppc
4 pkgver=4.4.0
5 _xsver=0.62
6 _rbpcver=3.1.3.0
7 pkgrel=6
8 pkgdesc='Enterprise-grade system for backing up Linux, Windows and MacOS PCs'
9 url='https://github.com/backuppc/'
10 license=('GPL2')
11 arch=('x86_64')
12 makedepends=('git')
13 depends=('glibc' 'popt' 'perl' 'par2cmdline' 'perl-archive-zip' 'perl-io-dirent'
14          'perl-file-listing' 'perl-time-modules' 'perl-cgi' 'perl-xml-rss'
15          'perl-json-xs' 'smtp-forwarder')
16 optdepends=('openssh: ssh transfert support'
17             'rsync: rsync transfert support'
18             'smbclient: smb/cifs transfert support'
19             'rrdtool: graphs of the pool usage ')
20 source=("https://github.com/backuppc/backuppc/releases/download/$pkgver/BackupPC-$pkgver.tar.gz"
21         "https://github.com/backuppc/backuppc-xs/releases/download/${_xsver}/BackupPC-XS-${_xsver}.tar.gz"
22         "https://github.com/backuppc/rsync-bpc/releases/download/${_rbpcver}/rsync-bpc-${_rbpcver}.tar.gz"
23         "$pkgname.service"
24         "$pkgname.sysusers"
25         "$pkgname.tmpfiles"
26         "$pkgname.profile.sh"
27         "$pkgname.profile.csh"
28         "$pkgname.httpd"
29         'https://github.com/backuppc/backuppc/commit/2c9270b9b849b2c86ae6301dd722c97757bc9256.patch')
30 install=$pkgname.install
31 backup=("etc/$pkgname/config.pl"
32         "etc/$pkgname/hosts"
33         "etc/httpd/conf/extra/$pkgname.conf"
34         "etc/$pkgname/$pkgname.users")
35 sha256sums=('8bc04cd513d47629508bd2fd6f455ced38316974913638e971f44e37786c6365'
36             '94d863083a466558f82f10b1b95db7742ea99ebce808214f20897b343dc32b18'
37             '3eeb137319b608512b2d23c54ea8b52b511db806ffbd5fa730a394431d556f3f'
38             '70b414d681b47b8b41a228d8155761eac5f67b63bcdc6e0e4da7a0d27f3b6810'
39             '82598186b24b28d7e76c174ac90b046831954d3ebfe22219fa67a9011e306f3f'
40             'ef5c4fde24e14ab5828fed085a7dd8fd699dfdbbd875bc6c29b41ec2b0ae645b'
41             'daa9690efe856b01dc749be0dcc8f3daebf7c1c62500df2431eeb2762b446284'
42             '2c96d3be7ce0f681ea4b34abab93154b086132166658a747a7a8ed8c7ed2757e'
43             '97dbe6a0c8302d0e6ff6f97e77ca9fb4187272abb43dd01fff431170b6d39e6e'
44             'b4547f90f903d067fd09c4f2c168e204d818b69543defa8cad5dbdd2dfc258eb')
46 prepare() {
47   cd BackupPC-$pkgver
48   # apply patch from the source array (should be a pacman feature)
49   local filename
50   for filename in "${source[@]}"; do
51     if [[ "$filename" =~ \.patch$ ]]; then
52       echo "Applying patch ${filename##*/}"
53       patch -p1 -N -i "$srcdir/${filename##*/}"
54     fi
55   done
56   :
59 build() {
60   echo 'rsync-bpc'
61   cd "$srcdir"/rsync-bpc-$_rbpcver
62   ./configure --prefix=/usr/share/backuppc
63   make
66 package() {
67   echo 'rsync-bpc'
68   cd "$srcdir"/rsync-bpc-$_rbpcver
69   make install DESTDIR="$pkgdir"
71   echo 'backuppc-xs'
72   cd "$srcdir"/BackupPC-XS-$_xsver
73   perl Makefile.PL INSTALLDIRS=vendor
74   make -j1 # parallel build fail
75   make install DESTDIR="$pkgdir"
77   echo 'backuppc'
78   cd "$srcdir"/BackupPC-$pkgver
79   export PERLLIB=$(echo "$pkgdir"/usr/lib/perl5/*/vendor_perl/)
80   perl configure.pl \
81     --batch \
82     --no-set-perms \
83     --uid-ignore \
84     --hostname __HOSTNAME__ \
85     --compress-level 5 \
86     --backuppc-user=backuppc \
87     --dest-dir "$pkgdir" \
88     --fhs \
89     --install-dir /usr/share/$pkgname \
90     --config-dir /etc/$pkgname \
91     --cgi-dir /usr/share/$pkgname/cgi-bin \
92     --html-dir /usr/share/$pkgname/html \
93     --html-dir-url /backuppc \
94     --data-dir /var/lib/$pkgname \
95     --log-dir /var/log/$pkgname \
96     --run-dir /run/$pkgname \
97     --bin-path rsync_bpc=/usr/share/backuppc/bin/rsync_bpc \
98     --bin-path smbclient=/usr/bin/smbclient \
99     --bin-path nmblookup=/usr/bin/nmblookup \
100     --bin-path rsync=/usr/bin/rsync \
101     --bin-path ssh=/usr/bin/ssh \
102     --bin-path sendmail=/usr/bin/sendmail \
103     --bin-path ping=/usr/bin/ping \
104     --bin-path ping6=/usr/bin/ping \
105     --bin-path rrdtool=/usr/bin/rrdtool \
106     --
107   cd "$srcdir"
108   # systemd
109   install -D -m 644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
110   install -D -m 644 $pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
111   install -D -m 644 $pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
112   # install shell profiles
113   install -D -m 755 $pkgname.profile.sh "$pkgdir/etc/profile.d/$pkgname.sh"
114   install -D -m 755 $pkgname.profile.csh "$pkgdir/etc/profile.d/$pkgname.csh"
115   # install apache http
116   install -D -m 644 $pkgname.httpd "$pkgdir/etc/httpd/conf/extra/$pkgname.conf"
117   install -D -m 640 /dev/null "$pkgdir/etc/$pkgname/$pkgname.users"
118   # set correct permissions
119   cd "$pkgdir"
120   chown 126:126 -R etc/$pkgname
121   chown 126:126 -R var/{log,lib}/$pkgname
122   chmod 755 etc
123   chmod 755 -R var usr/share/$pkgname/{cgi-,}bin
124   chmod 750 var/log/$pkgname etc/$pkgname
125   chmod 750 -R var/lib/$pkgname
126   chmod 640 etc/$pkgname/{config.pl,hosts}
127   # no /run
128   rm -rv "$pkgdir"/run
129   # no core_perl directory
130   rm -rv "$pkgdir"/usr/lib/perl5/*/core_perl
133 # vim:set ts=2 sw=2 et: