You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.9 KiB

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