bmeneguele

PKGBUILD

Sep 30th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.55 KB | None | 0 0
  1. ############
  2. # PKGBUILD file for the Concentrador SG project package.
  3. #############
  4.  
  5. pkgname="concentrador"
  6.  
  7. # This field will be filled by the pkgver() function
  8. pkgver=0.9b
  9.  
  10. # Unfortunatly this field is mandatory by the makepkg
  11. pkgrel=1
  12.  
  13. pkgdesc="Smartgreen gateway services and configurations"
  14. arch="any"
  15. url="http://repositorio.smartgreen.net.br/network/concentrador"
  16. license="unknown"
  17. depends=('iw' 'wireless_tools' 'nginx' 'hostapd' 'dhcp' 'wpa_supplicant' \
  18. 'openvpn' 'htop' 'vim' 'picocom' 'iputils' 'openvpn' 'usb_modeswitch' 'wvdial' \
  19. 'python2-pyserial' 'python2-pip' 'python2-tornado' 'python2-setuptools' 'gcc' \
  20. 'python2-psutil' 'python2-netifaces' 'python2-sensors' 'python2-pyudev' \
  21. 'i2c-tools')
  22. makedepends="git"
  23. provides="${pkgname}"
  24. conflicts="${pkgname}"
  25.  
  26. # Files to be backuped when upgrading (.pacnew) or removing (.pacsave) the
  27. # package installed.
  28. backup=('etc/wvdial.conf' 'etc/mobile/mobile.conf' \
  29. 'etc/modprobe.d/bcmdhd-op.conf' 'etc/systemd/timesyncd.conf' \
  30. 'etc/systemd/system/ap-sg.conf' 'etc/systemd/journald.conf' \
  31. 'etc/modules-load.d/bcmdhd.conf' 'etc/hostapd/hostapd.conf' \
  32. 'etc/openvpn/client.conf' 'etc/dhcpd.conf' 'etc/nginx/nginx.conf' \
  33. 'etc/sgcon/legacy.conf' 'etc/sgcon/appliance.conf' 'etc/sgcon/suite.conf' \
  34. 'etc/sgcon/monitor.conf' 'etc/sgcon/network.conf' 'etc/sgcon/serial.conf' \
  35. 'etc/dhcpcd.conf' 'etc/pacman.conf')
  36.  
  37. # Source diretcly from git repository
  38. source="git+http://repositorio.smartgreen.net.br/network/concentrador.git"
  39.  
  40. # As the source is in continuous modification the md5 check will be skiped for
  41. # now
  42. md5sums="SKIP"
  43.  
  44. # This will take the version number from the last tag commited
  45. pkgver() {
  46.     cd ${pkgname}
  47.  
  48.     git describe --long | cut -d '-' -f 1
  49. }
  50.  
  51. # Defines where the files must be located after installation
  52. package() {
  53.     cd ${srcdir}/${pkgname}
  54.    
  55.     # Create respective fakeroot folders
  56.     mkdir -p ${pkgdir}/etc
  57.     mkdir -p ${pkgdir}/home/concentrador/redes
  58.     mkdir -p ${pkgdir}/root
  59.    
  60.     # Specific 'concentrador' user's home folder access permission
  61.     chmod 700 ${pkgdir}/home/concentrador
  62.  
  63.     # Specific 'root' user's folder access permission
  64.     chmod 750 ${pkgdir}/root
  65.  
  66.     # Copy all files to its respective folders during installation process
  67.     cp -r linux-config/archlinux/etc/* ${pkgdir}/etc/
  68.     cp -r * ${pkgdir}/home/concentrador/redes/
  69.     cp linux-config/archlinux/config_sgcon.sh ${pkgdir}/root/
  70.    
  71.     # Change ownership to the 'concentrador' user (UID 1000)
  72.     chown -R 1000:1000 ${pkgdir}/home/concentrador/redes
  73. }
Advertisement
Add Comment
Please, Sign In to add comment