diff --git a/Makefile b/Makefile index 4ce218b..d6fe8f7 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,9 @@ TARGET=httpprocprobed SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} SYSDDIR=${SYSDDIR_:/%=%} + DESTDIR:= +PREFIX:=/usr/local VERSION:=3.0.0 @@ -17,15 +19,15 @@ ${TARGET}: ${SOURCES} go build ${LDFLAGS} ${FLAGS} install: - install -Dm 0755 ${TARGET} ${DESTDIR}usr/bin/${TARGET} - install -Dm 0644 configs/config.example.json ${DESTDIR}etc/${TARGET}.json - install -Dm 0644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE - install -Dm 0644 init/systemd.service ${DESTDIR}${SYSDDIR}/${TARGET}.service + install -Dm 0755 ${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET} + install -Dm 0644 configs/config.example.json ${DESTDIR}${PREFIX}etc/${TARGET}.json + install -Dm 0644 LICENSE ${DESTDIR}${PREFIX}/share/licenses/${TARGET}/LICENSE + install -Dm 0644 init/systemd.service ${DESTDIR}${PREFIX}${SYSDDIR}/${TARGET}.service uninstall: - rm ${DESTDIR}usr/bin/${TARGET} - rm ${DESTDIR}usr/share/licenses/${TARGET} - rm ${DESTDIR}${SYSDDIR}/${TARGET}.service + rm ${DESTDIR}${PREFIX}/bin/${TARGET} + rm ${DESTDIR}${PREFIX}/share/licenses/${TARGET} + rm ${DESTDIR}${PREFIX}${SYSDDIR}/${TARGET}.service clean: rm httpprocprobed \ No newline at end of file diff --git a/build/archlinux/PKGBUILD b/build/archlinux/PKGBUILD index 524d85e..0e029e0 100644 --- a/build/archlinux/PKGBUILD +++ b/build/archlinux/PKGBUILD @@ -9,15 +9,19 @@ license=('MIT') makedepends=('go>=1.17') backup=('etc/httpprocprobed.json') source=("https://git.arav.su/Arav/httpprocprobed/archive/$pkgver.tar.gz") -noextract=() md5sums=('SKIP') build() { cd "$srcdir/$pkgname" - make DESTDIR="$pkgdir/" + export GOPATH="$srcdir"/gopath + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + make VERSION=$pkgver DESTDIR="$pkgdir/" PREFIX="/usr" } package() { cd "$srcdir/$pkgname" - make DESTDIR="$pkgdir/" install + make DESTDIR="$pkgdir/" PREFIX="/usr" install } \ No newline at end of file