diff options
author | Chris Severance | 2015-07-29 20:25:26 -0400 |
---|---|---|
committer | Chris Severance | 2015-07-29 20:25:26 -0400 |
commit | 2d3f02adc4246465e891d4daa4bada94d19942da (patch) | |
tree | 5eae3df84339cd95b3d6234448b5689a889c6580 | |
parent | 01a3bf5250520400da7e4a73073ce3a776f08276 (diff) | |
download | aur-2d3f02adc4246465e891d4daa4bada94d19942da.tar.gz |
Can build client
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 104 | ||||
-rw-r--r-- | urbackup-client.service | 12 | ||||
-rw-r--r-- | urbackup-server.install | 2 |
4 files changed, 94 insertions, 30 deletions
@@ -1,5 +1,5 @@ pkgbase = urbackup-server-git - pkgdesc = Client/Server network backup for Windows and Linux + pkgdesc = Client/Server network backup for Windows and Linux, builds server or client pkgver = 1.4.9.r21.g6d3d464 pkgrel = 1 url = http://www.urbackup.org/ @@ -14,7 +14,11 @@ pkgbase = urbackup-server-git provides = urbackup-server conflicts = urbackup-server source = git+https://github.com/uroni/urbackup_backend.git + source = git+https://github.com/uroni/urbackup_frontend_wx.git + source = urbackup-client.service sha256sums = SKIP + sha256sums = SKIP + sha256sums = e4c40d10909417cd04898388bab41aa6434375b62944183f132e606ed71f70b2 pkgname = urbackup-server-git @@ -9,7 +9,7 @@ # TODO: Version numbers in git tags instead of scanning configuration files # TODO: Need to rebuild on upgrade: /var/urbackup/'{UrBackupUpdate.exe,UrBackupUpdate.sig} # TODO: New feature: [x] Follow symbolic links on Windows clients -# TODO: urbackup-client-git +# TODO: Why don't the libs have versions? # Build-n-install: makepkg -scCf # For running systems, watch htop and upgrade when your urbackup server processes are idle @@ -30,24 +30,45 @@ # server_ident.priv # server_ident.pub +if [ ! -s 'PKGBUILD.local' ]; then + cat > 'PKGBUILD.local' << EOF +_opt_BuildClient=0 # Default 0, 0=server, 1=client. You must use makepkg -sCf after changing this. +_opt_Headless=1 # Default 1, 0=GUI, 1=headless (only applies to client, ignored for server) +EOF +fi +source 'PKGBUILD.local' + set -u -_pkgname='urbackup-server' +if [ "${_opt_BuildClient}" -ne 0 ]; then + _pkgname='urbackup-client' +else + _pkgname='urbackup-server' +fi pkgname="${_pkgname}-git" pkgver=1.4.9.r21.g6d3d464 pkgrel=1 -pkgdesc='Client/Server network backup for Windows and Linux' +pkgdesc='Client/Server network backup for Windows and Linux, builds server or client' arch=('i686' 'x86_64') url='http://www.urbackup.org/' license=('GPL') depends=('crypto++') -optdepends=('btrfs-progs: compressed and subvolume assisted backups') makedepends=('python3' 'autoconf') provides=("${_pkgname}") conflicts=("${_pkgname}") -source=('git+https://github.com/uroni/urbackup_backend.git') -sha256sums=('SKIP') +source=('git+https://github.com/uroni/urbackup_backend.git' 'git+https://github.com/uroni/urbackup_frontend_wx.git' 'urbackup-client.service') +sha256sums=('SKIP' + 'SKIP' + 'e4c40d10909417cd04898388bab41aa6434375b62944183f132e606ed71f70b2') install=("${_pkgname}.install") _srcdir='urbackup_backend' +if [ "${_opt_BuildClient}" -ne 0 ]; then + unset install + if [ "${_opt_Headless}" -eq 0 ]; then + depends+=('wxgtk') + fi +else + optdepends=('btrfs-progs: compressed and subvolume assisted backups') +fi pkgver() { set -u @@ -69,21 +90,41 @@ pkgver() { prepare() { set -u cd "${srcdir}/${_srcdir}" - cp -p 'build_server.sh' 'build_server.Arch.sh' # git reset --hard immediately reverts the origional - sed -i -e '# Fix configure line' \ - -e 's:^\(\s*\)./configure.*$: ./configure --prefix="/usr" --sbindir="/usr/bin" --sysconfdir="/etc" --localstatedir="/var" --enable-packaging --with-mountvhd:g' \ - -e '# Block make so makepkg -e so works properly' \ - -e 's:^make:exit 0\n#&:g' \ - -e "# We'll do git reset so we can make a few changes afterwards" \ - -e 's:^git reset:#&:g' \ - 'build_server.Arch.sh' git reset --hard + # Some patches sed -i -e 's:$PREFIX/sbin/:$PREFIX/bin/:g' start_urbackup_{client,server} sed -i -e 's:/sbin/btrfs:/usr/bin/btrfs:g' 'snapshot_helper/main.cpp' sed -i -e 's:/usr/sbin/:/usr/bin/:g' 'urbackupserver/doc/admin_guide.tex' 'urbackup-server.service' sed -i -e 's,L"C:\\\\urbackup",\n#ifdef _WIN32\n&\n#else\nL"/urbackup"\n#endif\n,g' 'urbackupserver/server_settings.cpp' # Irksome bug! - sh 'build_server.Arch.sh' - rm -f 'build_server.Arch.sh' + + # fix the build scripts + cp -p 'build_server.sh' 'build_server.Arch.sh' + cp -p 'build_client.sh' 'build_client.Arch.sh' + sed -i -e '# Block make so makepkg -e so works properly' \ + -e 's:^make:exit 0\n#&:g' \ + -e "# We'll do git reset so we can make a few changes afterwards" \ + -e 's:^git reset:#&:g' \ + 'build_server.Arch.sh' 'build_client.Arch.sh' + if [ "${_opt_BuildClient}" -ne 0 ]; then + ln -sf '../urbackup_frontend_wx' 'client' + if [ "${_opt_Headless}" -eq 0 ]; then + sed -i -e '# Fix configure line' \ + -e 's:^\(\s*\)./configure.*$: ./configure --prefix="/usr" --sbindir="/usr/bin" --localstatedir="/var":g' \ + 'build_client.Arch.sh' + else + sed -i -e '# Fix configure line' \ + -e 's:^\(\s*\)./configure.*$: ./configure --prefix="/usr" --sbindir="/usr/bin" --localstatedir="/var" --enable-headless:g' \ + 'build_client.Arch.sh' + fi + sh 'build_client.Arch.sh' + else + rm -f 'client' # to be pedantic + sed -i -e '# Fix configure line' \ + -e 's:^\(\s*\)./configure.*$: ./configure --prefix="/usr" --sbindir="/usr/bin" --sysconfdir="/etc" --localstatedir="/var" --enable-packaging --with-mountvhd:g' \ + 'build_server.Arch.sh' + sh 'build_server.Arch.sh' + fi + rm -f 'build_server.Arch.sh' 'build_client.Arch.sh' set +u } @@ -101,20 +142,27 @@ package() { make DESTDIR="${pkgdir}" install - local _serverkey - for _serverkey in 'server_ident.key' 'server_ident.priv' 'server_ident.pub'; do - install -Dpm644 "${srcdir}/../${_serverkey}" "${pkgdir}/var/urbackup/${_serverkey}" || : - done + if [ "${_opt_BuildClient}" -ne 0 ]; then + install -Dm755 "${srcdir}/urbackup-client.service" -t "${pkgdir}/usr/lib/systemd/system/" + sed -i -e 's:/usr/sbin/:/usr/bin/:g' "${pkgdir}/usr/lib/systemd/system/urbackup-client.service" + install -Dm644 "docs/start_urbackup_client.1" -t "${pkgdir}/usr/share/man/man1/" + install -Dm644 "docs/urbackup_client.1" -t "${pkgdir}/usr/share/man/man1/" + else + local _serverkey + for _serverkey in 'server_ident.key' 'server_ident.priv' 'server_ident.pub'; do + install -Dpm644 "${srcdir}/../${_serverkey}" "${pkgdir}/var/urbackup/${_serverkey}" || : + done - # special btrfs support - install -dm755 "${pkgdir}/etc/urbackup" - echo '/urbackup' > "${pkgdir}/etc/urbackup/backupfolder" - chmod 644 "${pkgdir}/etc/urbackup/backupfolder" + # special btrfs support + install -dm755 "${pkgdir}/etc/urbackup" + echo '/urbackup' > "${pkgdir}/etc/urbackup/backupfolder" + chmod 644 "${pkgdir}/etc/urbackup/backupfolder" - install -Dpm644 'urbackup-server.service' -t "${pkgdir}/usr/lib/systemd/system/" - install -Dpm644 'urbackup-server-firewalld.xml' -t "${pkgdir}/usr/lib/firewalld/services/" - install -Dpm644 'logrotate_urbackup_srv' "${pkgdir}/etc/logrotate.d/urbackup_srv" - install -Dpm644 docs/{start_urbackup_server,urbackup_srv}.1 -t "${pkgdir}/usr/share/man/man1/" + install -Dpm644 'urbackup-server.service' -t "${pkgdir}/usr/lib/systemd/system/" + install -Dpm644 'urbackup-server-firewalld.xml' -t "${pkgdir}/usr/lib/firewalld/services/" + install -Dpm644 'logrotate_urbackup_srv' "${pkgdir}/etc/logrotate.d/urbackup_srv" + install -Dpm644 docs/{start_urbackup_server,urbackup_srv}.1 -t "${pkgdir}/usr/share/man/man1/" + fi # Ensure there are no forbidden paths. Comment these out as you find or need exceptions. (git-aurcheck) ! grep -alqr "/sbin" "${pkgdir}" || echo "${}" diff --git a/urbackup-client.service b/urbackup-client.service new file mode 100644 index 000000000000..aad06fb3d751 --- /dev/null +++ b/urbackup-client.service @@ -0,0 +1,12 @@ +[Unit] +Description=UrBackup Client +After=syslog.target network.target + +[Service] +Type=forking +NotifyAccess=all +PIDFile=/run/urbackup_client.pid +ExecStart=/usr/sbin/start_urbackup_client --logfile urbackup_client.log --loglevel error + +[Install] +WantedBy=multi-user.target diff --git a/urbackup-server.install b/urbackup-server.install index 0a0ded8ba73a..ef58e4874697 100644 --- a/urbackup-server.install +++ b/urbackup-server.install @@ -1,7 +1,7 @@ post_upgrade() { mandb -q systemctl daemon-reload - # The Win client hasn't changed in years so we don't need them to upgrade. + # The Win client doesn't change much so we don't need them to upgrade. #rm -f '/var/urbackup/'{UrBackupUpdate.exe,UrBackupUpdate.sig,server_token.key} # urbackup might use server_version_info.properties for db version } |