Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # THESE ARE TWO SEPARATE FILES
- # 1) PKGBUILD
- # 2) services.install
- # THEY MUST BE IN THE SAME DIRECTORY WHEN INVOKING makepkg
- ########## PKGBUILD STARTS HERE ##########
- pkgname=remotepc-bin
- altpkgname=remotepc
- pkgver=4.4.0
- pkgrel=1
- provides=('remotepc')
- pkgdesc="Access your remote computer from any Windows, Mac, or Linux computer, iOS or Android device, or via the web"
- arch=('x86_64')
- url="https://www.remotepc.com"
- dlurl="https://static.remotepc.com/downloads"
- shortname="rpc"
- internalnum="310320"
- license=('custom')
- install="services.install"
- source=(${altpkgname}.deb::${dlurl}/${shortname}/${internalnum}/${altpkgname}.deb)
- sha1sums=('4abfeec607edf810aed58fec2bbb2507da2ba1ea')
- package() {
- cd ${srcdir}
- # Extract files from the .deb archive
- ar xvf ${altpkgname}.deb
- tar xvf data.tar.xz
- tar xvf control.tar.gz
- # Copy directories exactly as found in the .deb archive instructions
- cp -rv "${srcdir}/opt" "${pkgdir}"
- cp -rv "${srcdir}/usr" "${pkgdir}"
- # Prepare files and directories based on .deb archive instructions
- touch "${pkgdir}/opt/remotepc/chrome-sandbox"
- chmod 4755 "${pkgdir}/opt/remotepc/chrome-sandbox"
- touch "${pkgdir}/opt/remotepc/resources/isTnCAccepted"
- chmod ugo+rwx "${pkgdir}/opt/remotepc/resources/isTnCAccepted"
- # Prepare services directories and copy systemd units from /opt/ directory in .deb archive
- mkdir -p "${pkgdir}/etc/systemd/system"
- mkdir -p "${pkgdir}/etc/systemd/user"
- mkdir -p "${pkgdir}/usr/bin"
- cp -f "${pkgdir}/opt/remotepc/remotepc.service" "${pkgdir}/etc/systemd/system/"
- cp -f "${pkgdir}/opt/remotepc/remotepc_installer.service" "${pkgdir}/etc/systemd/system/"
- cp -f "${pkgdir}/opt/remotepc/remotepc-desktop.service" "${pkgdir}/etc/systemd/user/"
- # Make symlink to binary executable
- ln -sf "${pkgdir}/opt/remotepc/remotepc" "${pkgdir}/usr/bin/remotepc"
- # Prepare exclusive log directory
- mkdir -p "${pkgdir}/var/log/remotepc"
- chmod 777 "${pkgdir}/var/log/remotepc"
- }
- ########## PKGBUILD ENDS HERE ##########
- ########## services.install STARTS HERE ##########
- post_install() {
- # Enable and start remotepc systemd service
- systemctl daemon-reload
- systemctl enable remotepc.service
- systemctl restart remotepc.service
- }
- pre_remove() {
- # Stop and distable remotepc systemd service
- systemctl stop remotepc.service
- systemctl disable remotepc.service
- }
- post_remove() {
- # Some newly created (residual) ROOT "config" files leftover?
- # Yet, USER config files remain under $HOME/.config/remotepc/
- # /opt/remotepc is no longer needed
- rm -rf /opt/remotepc
- }
- ########## services.install ENDS HERE ##########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement