glib2: use internal pcre2
[feed/packages.git] / admin / backuppc / Makefile
1 # Copyright (C) 2018 OpenWrt
2 #
3 # Ideas used from the backuppc packaging in Debian GNU/Linux
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=backuppc
9 PKG_VERSION:=3.3.2
10 PKG_RELEASE:=3
11
12 PKG_SOURCE:=BackupPC-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=@SF/backuppc
14 PKG_HASH:=fbade2c8d8039297e826a75d2c39d5ac9a6f66e0c84c0cf8c4cef0bcf64d2152
15 PKG_BUILD_DIR:=$(BUILD_DIR)/BackupPC-$(PKG_VERSION)
16
17 PKG_MAINTAINER:=Carsten Wolff <carsten@wolffcarsten.de>
18 PKG_LICENSE:=GPL-2.0-or-later
19 PKG_LICENSE_FILES:=LICENSE
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/backuppc
24 SECTION:=admin
25 CATEGORY:=Administration
26 TITLE:=high-performance, enterprise-grade system for backing up PCs
27 URL:=https://sourceforge.net/projects/backuppc/
28 DEPENDS:=+perl +perl-www +perl-cgi +perlbase-digest +perlbase-compress +perlbase-archive +perlbase-data +perlbase-storable +perlbase-getopt +perl-file-rsyncp +openssh-client +tar +bzip2 +samba4-client +rsync +iputils-ping
29 endef
30
31 define Package/backuppc/description
32 BackupPC is a disk based backup system featuring a clever pooling scheme and
33 compression to minimize disk storage and disk I/O. It can use SMB, rsync or tar
34 to access the clients without any additional client software and offers a
35 powerful http/cgi user interface.
36 endef
37
38 define Build/Configure
39 true
40 endef
41
42 define Build/Compile
43 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -Wall -o $(PKG_BUILD_DIR)/BackupPC_Admin ./files/setuidwrapper.c
44 endef
45
46 define Package/backuppc/install
47 $(INSTALL_DIR) $(strip $(1))/etc/init.d
48 $(INSTALL_BIN) ./files/backuppc.init $(strip $(1))/etc/init.d/backuppc
49 cd $(PKG_BUILD_DIR) && ./configure.pl --batch --html-dir-url=/backuppc/ \
50 --html-dir=/www/backuppc/ --cgi-dir=/www/cgi-bin/ --no-fhs --uid-ignore \
51 --dest-dir=$(strip $(1)) --install-dir /usr/share/backuppc \
52 --hostname=XXXXXX --data-dir=/data/backuppc --log-dir=/data/backuppc/log \
53 --bin-path perl=/usr/bin/perl --bin-path tar=/bin/tar \
54 --bin-path smbclient=/usr/sbin/smbclient --bin-path nmblookup=/usr/sbin/nmblookup \
55 --bin-path rsync=/usr/bin/rsync --bin-path ping=/usr/bin/ping --bin-path df=/bin/df \
56 --bin-path ssh=/usr/bin/ssh --bin-path gzip=/bin/gzip \
57 --bin-path sendmail=/usr/sbin/sendmail --bin-path bzip2=/usr/bin/bzip2 \
58 --bin-path par2=
59 $(INSTALL_DIR) $(strip $(1))/usr/share/backuppc/conf
60 chmod 755 $(strip $(1))/data
61 mv $(strip $(1))/data/backuppc/conf/config.pl $(strip $(1))/usr/share/backuppc/conf/config.pl
62 patch --no-backup-if-mismatch $(strip $(1))/usr/share/backuppc/conf/config.pl ./files/fixup-config-pl.patch
63 mv $(strip $(1))/www/cgi-bin/BackupPC_Admin $(strip $(1))/usr/share/backuppc/bin/BackupPC_Admin_real
64 $(INSTALL_BIN) $(PKG_BUILD_DIR)/BackupPC_Admin $(strip $(1))/www/cgi-bin/BackupPC_Admin
65 $(INSTALL_DIR) $(strip $(1))/lib/upgrade/keep.d
66 $(INSTALL_DATA) files/backuppc.upgrade $(strip $(1))/lib/upgrade/keep.d/backuppc
67 endef
68
69 $(eval $(call BuildPackage,backuppc))