# Maintainer: Techcable <$USERNAME at techcable.net> # This package is mirored on github at Techcable/archlinux-packages # PRs and issues welcome # This package uses precompiled jar files, see README.md for justification pkgname=dis4irc pkgver=1.6.2 pkgrel=1 pkgdesc="A modern Discord <-> IRC bridge" arch=('any') # Java :) url="https://github.com/zachbr/Dis4IRC" license=('MIT') # The downloaded jar is compiled with Java 11 depends=('java-runtime>=11') # We put the config here backup=('etc/dis4irc/config.hocon') options=(!strip) # We have to change the permissions on /etc/dis4irc/config.hocon # # to be writable by the `dis4irc` user, because Sponge's configurate # modifies the config file install=dis4irc.install source=( # It's just a github release "https://github.com/zachbr/Dis4IRC/releases/download/v${pkgver}/Dis4IRC-${pkgver}.jar" # License is required for MIT per the official packaging guideliness "https://raw.githubusercontent.com/zachbr/Dis4IRC/v${pkgver}/LICENSE.md" # We create a dedcicated dis4irc user "dis4irc-sysusers.conf" # I wrote my own systemd file (kind of overkill huh) "dis4irc.service" ) noextract=( # Jar is just a zip file, and we do *NOT* want it extracted "Dis4IRC-${pkgver}.jar" ) sha256sums=('631bd64425a66561816d5deacb63cd8b0cc7ca089487f8dabb65584623b79a32' '3b0e019e48300b84a62273422b1deda67d548d38d5037fd94a0f2af54c96d4c8' 'd8c07815db79c8e9e6d9dec5fe2bca2fe3d1ed11470f4eb232c0bce7c87e2a4d' 'fe49b0c125e69433b91be596cd627424f464e609d39996693ae017889f2b31c4') build() { # Default config file doesn't exist. We have to generate it # remove previous default config (autogenerated) rm -f "${srcdir}/default-config.hocon" echo "=============================" echo " Generating Default Config " echo "=============================" echo "NOTE: Network connection & discord API calls should fail, but no other errors should occur" echo # Generate the configuration file by invoking the jar # # This will fail (without connecting to anything), but it will successfully generate the default config in the process. java -jar "$srcdir/Dis4IRC-${pkgver}.jar" --config "${srcdir}/default-config.hocon" "$pkgdir/" || true } package() { # Per the java packaging guidelines, we place jar files into /usr/share/java/dis4irc install -Dm644 "$srcdir/Dis4IRC-${pkgver}.jar" "$pkgdir/usr/share/java/dis4irc/Dis4IRC.jar" # We install the "default" config into /etc/dis4irc/config.hocon install -Dm644 "$srcdir/default-config.hocon" "$pkgdir/etc/dis4irc/config.hocon" install -Dm644 "$srcdir/dis4irc.service" "$pkgdir/usr/lib/systemd/system/dis4irc.service" install -Dm644 "$srcdir/dis4irc-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/dis4irc.conf" install -Dm644 "$srcdir/LICENSE.md" "$pkgdir/usr/share/licenses/dis4irc/LICENSE.md" }