aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD71
-rw-r--r--nordlayer.install92
3 files changed, 112 insertions, 69 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c6c62d506ed5..c49b4ad0c035 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,22 @@
pkgbase = nordlayer
- pkgdesc = Proprietary VPN client for linux
- pkgver = 3.1.0
- pkgrel = 0
+ pkgdesc = Proprietary VPN client for Linux
+ pkgver = 3.2.2
+ pkgrel = 1
url = https://nordlayer.com
install = nordlayer.install
- arch = i686
arch = x86_64
- license = custom
+ license = custom:commercial
depends = bash
+ depends = libgcrypt
+ depends = libgpg-error
+ depends = libcap
+ depends = hicolor-icon-theme
+ depends = gmp
conflicts = nordvpnteams-bin
replaces = nordvpnteams-bin
options = !strip
options = !emptydirs
- source_x86_64 = https://downloads.nordlayer.com/linux/latest/debian/pool/main/nordlayer_3.1.0_amd64.deb
- sha512sums_x86_64 = 8e8f369db2bd6ada11564ab8be06f9faa6efa1a11f324956698c3b8b2da8a489ca685ed68e4e775e05e17e363a661f0af6e5c05d6d3cff76ed83e032ef815cdb
+ source_x86_64 = https://downloads.nordlayer.com/linux/latest/debian/pool/main/nordlayer_3.2.2_amd64.deb
+ sha512sums_x86_64 = f076ae853fb87941d1bc8c7cd34c31d233343a86b1d6b123353c328fda3fd938b7e38741ba1399f63eb2cdda990ddf460fde25e035eb810ea0c3d7de7e5303b2
pkgname = nordlayer
diff --git a/PKGBUILD b/PKGBUILD
index d70b812c2eee..172103376e96 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,59 @@
-# Maintainer: Deividas Gedgaudas <sidicer at gmail dot com>
-
+# Maintainer: Roland Kiraly <rolandgyulakiraly at outlook dot com>
+# https://github.com/raverecursion/nordlayer-latest/tree/master
pkgname=nordlayer
-pkgver=3.1.0
-pkgrel=0
-pkgdesc="Proprietary VPN client for linux"
-arch=('i686' 'x86_64')
+pkgver=3.2.2
+pkgrel=1
+pkgdesc="Proprietary VPN client for Linux"
+arch=('x86_64')
url="https://nordlayer.com"
-license=('custom')
+license=('custom:commercial')
replaces=('nordvpnteams-bin')
conflicts=('nordvpnteams-bin')
-depends=('bash')
-#backup=('etc/default/nordlayer' 'etc/nordlayer/config.hcl' 'etc/nordlayer/ipsec.secrets')
+depends=('bash' 'libgcrypt' 'libgpg-error' 'libcap' 'hicolor-icon-theme' 'gmp')
options=('!strip' '!emptydirs')
install=${pkgname}.install
-source_x86_64=("https://downloads.nordlayer.com/linux/latest/debian/pool/main/${pkgname}_${pkgver}_amd64.deb")
-sha512sums_x86_64=('8e8f369db2bd6ada11564ab8be06f9faa6efa1a11f324956698c3b8b2da8a489ca685ed68e4e775e05e17e363a661f0af6e5c05d6d3cff76ed83e032ef815cdb')
-
-package(){
- # Extract package data
- #tar xzf data.tar.gz -C "${pkgdir}"
- bsdtar -O -xf *.deb data.tar.gz | bsdtar -C "${pkgdir}" -xJf -
- cp -r "${pkgdir}/usr/sbin/." "${pkgdir}/usr/bin"
- sed -i 's+sbin+bin+g' "${pkgdir}/usr/lib/systemd/system/nordlayer.service"
- rm -r "${pkgdir}/usr/sbin"
+source_x86_64=("https://downloads.nordlayer.com/linux/latest/debian/pool/main/nordlayer_${pkgver}_amd64.deb")
+sha512sums_x86_64=('f076ae853fb87941d1bc8c7cd34c31d233343a86b1d6b123353c328fda3fd938b7e38741ba1399f63eb2cdda990ddf460fde25e035eb810ea0c3d7de7e5303b2')
+
+prepare() {
+ cd "${srcdir}"
+ ar x "nordlayer_${pkgver}_amd64.deb"
+ tar -xf data.tar.gz -C "${srcdir}" || tar -xf data.tar.xz -C "${srcdir}" || tar -xf data.tar.bz2 -C "${srcdir}" || tar -xf data.tar -C "${srcdir}"
+}
+
+package() {
+ cd "${srcdir}"
+ mkdir -p "${pkgdir}"
+
+ # Copy all necessary directories and files
+ cp -r etc "${pkgdir}/"
+ cp -r usr "${pkgdir}/"
+ cp -r var "${pkgdir}/"
+
+ # Move /usr/sbin/nordlayerd to /usr/bin
+ if [ -f "${pkgdir}/usr/sbin/nordlayerd" ]; then
+ mkdir -p "${pkgdir}/usr/bin"
+ mv "${pkgdir}/usr/sbin/nordlayerd" "${pkgdir}/usr/bin/nordlayerd"
+ rm -rf "${pkgdir}/usr/sbin"
+ fi
+
+ # Fix the systemd service file to point to the correct executable path
+ sed -i 's|ExecStart=/usr/sbin/nordlayerd|ExecStart=/usr/bin/nordlayerd|' "${pkgdir}/usr/lib/systemd/system/nordlayer.service"
+
+ # Ensure the necessary directories exist and have the correct permissions
+ install -d -m 0755 "${pkgdir}/run/nordlayer"
+ chown -R nordlayer:nordlayer "${pkgdir}/run/nordlayer"
+
+ # Set permissions for executable files
+ chmod 755 "${pkgdir}/usr/bin/nordlayer"
+ chmod 755 "${pkgdir}/usr/bin/nordlayerd"
+ chmod 755 "${pkgdir}/usr/libexec/nordlayer/nordlayer-charon"
+ chmod 755 "${pkgdir}/usr/libexec/nordlayer/nordlayer-ip"
+ chmod 755 "${pkgdir}/usr/libexec/nordlayer/nordlayer-openvpn"
+ chmod 755 "${pkgdir}/usr/libexec/nordlayer/nordlayer-resolvconf"
+ chmod 755 "${pkgdir}/usr/libexec/nordlayer/nordlayer-setcap"
+
+ # Log the final contents for debugging
+ echo "Final contents in ${pkgdir}:"
+ find "${pkgdir}"
}
diff --git a/nordlayer.install b/nordlayer.install
index 187e966d4040..18d381b92c9b 100644
--- a/nordlayer.install
+++ b/nordlayer.install
@@ -2,54 +2,60 @@ VAR_LIB=/var/lib/nordlayer
NORDLAYER_RESOLVCONF=/usr/libexec/nordlayer/nordlayer-resolvconf
post_install() {
-
- # Allow the daemon executable to bind to port 500 and administer network
- setcap CAP_NET_BIND_SERVICE,CAP_NET_ADMIN,CAP_NET_RAW+eip /usr/bin/nordlayerd
- setcap CAP_NET_BIND_SERVICE,CAP_NET_ADMIN,CAP_NET_RAW+eip /usr/bin/nordlayer-openvpn
-
- groupadd -r -f nordlayer
- groupadd -r -f nordlayer-resolve
-
- if ! id "nordlayer" >/dev/null 2>&1; then
- useradd -s /usr/bin/nologin -c "Used for running NordLayer" -r -M -d /run/nordlayer -g nordlayer nordlayer
- fi
-
- usermod -a -G nordlayer-resolve nordlayer
-
- mkdir -p ${VAR_LIB}
- chmod 0770 -R ${VAR_LIB}
- chown nordlayer:nordlayer -R ${VAR_LIB}
-
- chown root:nordlayer-resolve ${NORDLAYER_RESOLVCONF}
- chmod 4750 ${NORDLAYER_RESOLVCONF}
- # Ensure nordlayer-resolvconf has execute permissions
- chmod +x ${NORDLAYER_RESOLVCONF}
- # Reload config
- systemctl daemon-reload
-
- # Create tmpfiles
- systemd-tmpfiles --create
-
- # Start service on boot
- systemctl enable nordlayer.socket
- systemctl enable nordlayer.service
-
- # Restart service now
- systemctl start nordlayer.socket
- systemctl start nordlayer.service
-
+ # Allow the daemon executable to bind to port 500 and administer network
+ setcap CAP_NET_BIND_SERVICE,CAP_NET_ADMIN,CAP_NET_RAW+eip /usr/bin/nordlayerd
+ setcap CAP_NET_BIND_SERVICE,CAP_NET_ADMIN,CAP_NET_RAW+eip /usr/libexec/nordlayer/nordlayer-openvpn
+
+ groupadd -r -f nordlayer
+ groupadd -r -f nordlayer-resolve
+
+ if ! id "nordlayer" >/dev/null 2>&1; then
+ useradd -s /usr/bin/nologin -c "Used for running NordLayer" -r -M -d /run/nordlayer -g nordlayer nordlayer
+ fi
+
+ usermod -a -G nordlayer-resolve nordlayer
+
+ mkdir -p ${VAR_LIB}
+ chmod 0770 -R ${VAR_LIB}
+ chown nordlayer:nordlayer -R ${VAR_LIB}
+
+ chown root:nordlayer-resolve ${NORDLAYER_RESOLVCONF}
+ chmod 4750 ${NORDLAYER_RESOLVCONF}
+ # Ensure nordlayer-resolvconf has execute permissions
+ chmod +x ${NORDLAYER_RESOLVCONF}
+ # Reload config
+ systemctl daemon-reload
+
+ # Create tmpfiles
+ systemd-tmpfiles --create
+
+ # Start service on boot
+ systemctl enable nordlayer.socket
+ systemctl enable nordlayer.service
+
+ # Restart service now
+ systemctl start nordlayer.socket
+ systemctl start nordlayer.service
+
+ # Add current user to nordlayer group
+ current_user=$(logname)
+ if [ -n "$current_user" ]; then
+ usermod -a -G nordlayer "$current_user"
+ echo "User $current_user has been added to the 'nordlayer' group. Please log out and log back in for changes to take effect."
+ else
+ echo "Could not determine the current user. Please manually add the user to the 'nordlayer' group."
+ fi
}
post_upgrade() {
- post_install
+ post_install
}
pre_remove() {
+ rm -rf ${VAR_LIB}
+ systemctl disable nordlayer.service
+ systemctl disable nordlayer.socket
- rm -rf ${VAR_LIB}
- systemctl disable nordlayer.service
- systemctl disable nordlayer.socket
-
- systemctl stop nordlayer.service
- systemctl stop nordlayer.socket
+ systemctl stop nordlayer.service
+ systemctl stop nordlayer.socket
}