You are not logged in.

#1 2024-05-31 15:07:45

Jenil
Member
Registered: 2024-05-31
Posts: 13

PKGBUILD review: arch-torification

Hi, i almost forgot the review step..
I Have uploaded the PKGBUILD and if there are any errors please comment so i can update
Also after uploading package i cant connect to aur.archlinux.org with my wifi i have opened the topic under newbies section..
PKGBUILD :

# Maintainer: Jenil
pkgname=arch-torification
pkgver=1.1
pkgrel=1
pkgdesc="A tool for full system torification of Arch Linux"
arch=('x86_64')
url="https://github.com/jenil1122/Arch-torification"
license=('GPL3')
source=("https://github.com/jenil1122/Arch-torification/releases/download/${pkgver}/arch-torification")
sha256sums=('SKIP')
conflicts=("arch-torification")
export LDFLAGS+=" -Wl,-z,relro,-z,now"


package() {
    install -Dm755 arch-torification "${pkgdir}/usr/bin/arch-torification"
    hash -r
}

Offline

#2 2024-05-31 15:36:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,043

Re: PKGBUILD review: arch-torification

What in the world are you even downloading? The repo has a bash script, yet you're linking to some ELF binary?
license=('GPL3') is the old format, see the license section of the PKGBUILD wiki page.
A package conflicting with itself makes no sense. It can't be installed at the same time as itself?
The source file needs renamed. You'll get conflicts when there's a new version, but you have the old source file.
Don't skip the checksum.
hash -r in the package function isn't doing anything useful.
Does it really have no deps? Not even tor?
What's the point of setting LDFLAGS when you're not linking anything? Even if you were, you're adding flags that are already default?

Last edited by Scimmia (2024-05-31 15:47:27)

Offline

#3 2024-05-31 16:03:22

Jenil
Member
Registered: 2024-05-31
Posts: 13

Re: PKGBUILD review: arch-torification

updated PKGBUILD

# Maintainer: Jenil
pkgname=arch-torification
pkgver=1.1
pkgrel=1
pkgdesc="A tool for full system torification of Arch Linux"
arch=('x86_64')
url="https://github.com/jenil1122/Arch-torification"
license=('GPL')
depends=('tor' 'iptables')
provides=("${pkgname}")
source=("git+https://github.com/jenil1122/Arch-torification#branch=main")
md5sums=('SKIP')
package() {
    cd "${srcdir}/Arch-torification" || return
    install -Dm755 arch-torification "${pkgdir}/usr/bin/arch-torification"
}

Last edited by Jenil (2024-05-31 16:37:38)

Offline

#4 2024-05-31 16:06:59

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,043

Re: PKGBUILD review: arch-torification

license still wrong
Source at least isn't a binary anymore (which makes arch=('x86_64') wrong), but now you're downloading from main HEAD instead of a release? That's not good.

Offline

#5 2024-05-31 16:58:33

Jenil
Member
Registered: 2024-05-31
Posts: 13

Re: PKGBUILD review: arch-torification

ok now? anything else needed?

# Maintainer: Jenil
pkgname=arch-torification
pkgver=1.1
pkgrel=1
pkgdesc="A tool for full system torification of Arch Linux"
arch=('x86_64')
url="https://github.com/jenil1122/Arch-torification"
license=('GPL-3.0-only')
depends=('tor' 'iptables')
provides=("${pkgname}")
source=("git+https://github.com/jenil1122/Arch-torification#branch=release")
sha256sums=("SKIP")
package() {
    cd "${srcdir}/Arch-torification" || return
    install -Dm755 arch-torification "${pkgdir}/usr/bin/arch-torification"
}

Offline

#6 2024-05-31 17:12:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,043

Re: PKGBUILD review: arch-torification

So now you've got a -git package that's named wrong.

Why are you making this so difficult? Download the file, usually from the tag, renamed appropriately, and install it as whatever name you want. https://wiki.archlinux.org/title/PKGBUILD#source . You keep making changes upstream when there's no need for that at all.

Why did you add the provides? To make sure you can use arch-torification in place of arch-torification?

Last edited by Scimmia (2024-05-31 17:13:36)

Offline

#7 2024-06-01 12:59:43

cmm11
Member
Registered: 2018-02-18
Posts: 50

Re: PKGBUILD review: arch-torification

setup_tor_iptables() {
    if [ -d "/etc/iptables" ]; then
        echo "Removing existing files in /etc/iptables directory..."
        sudo rm -rf /etc/iptables/*
    else
        echo "Creating /etc/iptables directory..."
        sudo mkdir -p /etc/iptables
    fi

    sudo tee /etc/iptables/iptables.rules /etc/iptables/ip6tables.rules > /dev/null <<EOF

Is your script really nuking the user's /etc/iptables folder ? hmm
https://github.com/jenil1122/Arch-torif … C1-L112C90

Last edited by cmm11 (2024-06-01 13:00:57)


$20 Free Credit Hetzner - https://hetzner.cloud/?ref=fuVilhv403fA

Offline

#8 2024-06-01 13:52:16

Jenil
Member
Registered: 2024-05-31
Posts: 13

Re: PKGBUILD review: arch-torification

cmm11 wrote:
setup_tor_iptables() {
    if [ -d "/etc/iptables" ]; then
        echo "Removing existing files in /etc/iptables directory..."
        sudo rm -rf /etc/iptables/*
    else
        echo "Creating /etc/iptables directory..."
        sudo mkdir -p /etc/iptables
    fi

    sudo tee /etc/iptables/iptables.rules /etc/iptables/ip6tables.rules > /dev/null <<EOF

Is your script really nuking the user's /etc/iptables folder ? hmm
https://github.com/jenil1122/Arch-torif … C1-L112C90

fixed now its backing up and nuking the old backup if any..

Offline

Board footer

Powered by FluxBB