Skip to content

Instantly share code, notes, and snippets.

@ShaRose
Created October 15, 2017 23:20
Show Gist options
  • Save ShaRose/e6c9ece0f1a305c09b4f75cf8cb4ec74 to your computer and use it in GitHub Desktop.
Save ShaRose/e6c9ece0f1a305c09b4f75cf8cb4ec74 to your computer and use it in GitHub Desktop.
diff --git a/Makefile b/Makefile
index 925cdc0..8b7b9bb 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@ CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
LDFLAGS_LIB = $(LDFLAGS) -shared
INSTALL ?= install
-PREFIX ?= $(DESTDIR)/usr/local
+PREFIX ?= /usr/local
LIBDIR = $(PREFIX)/lib
INCLUDEDIR = $(PREFIX)/include
@@ -131,21 +131,22 @@ tags: http_parser.c http_parser.h test.c
ctags $^
install: library
- $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
- $(INSTALL) -D $(LIBNAME) $(LIBDIR)/$(LIBNAME)
- ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME)
- ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT)
+ $(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h
+ $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ ln -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
+ ln -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
install-strip: library
- $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h
- $(INSTALL) -D -s $(LIBNAME) $(LIBDIR)/$(LIBNAME)
- ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SONAME)
- ln -s $(LIBDIR)/$(LIBNAME) $(LIBDIR)/$(SOLIBNAME).$(SOEXT)
+ $(INSTALL) -D http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h
+ $(INSTALL) -D -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ ln -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
+ ln -s $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
uninstall:
- rm $(INCLUDEDIR)/http_parser.h
- rm $(LIBDIR)/$(SONAME)
- rm $(LIBDIR)/libhttp_parser.so
+ rm $(DESTDIR)$(INCLUDEDIR)/http_parser.h
+ rm $(DESTDIR)$(LIBDIR)/$(SOLIBNAME).$(SOEXT)
+ rm $(DESTDIR)$(LIBDIR)/$(SONAME)
+ rm $(DESTDIR)$(LIBDIR)/$(LIBNAME)
clean:
rm -f *.o *.a tags test test_fast test_g \
# Maintainer: Brian Bidulock <bidulock@openss7.org>
pkgname=http-parser-git
pkgver=2.7.1.r11.gfd3850c
pkgrel=1
pkgdesc="Parser for HTTP Request/Response written in C"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/nodejs/http-parser"
license=('MIT')
depends=('glibc')
makedepends=('git')
conflicts=('http-parser')
provides=('http-parser')
source=("$pkgname::git+https://github.com/nodejs/http-parser.git"
"http-parser.patch")
sha256sums=('SKIP'
'670621b040a5cbf2c62ccc79c5ed044cadb29b3da1441ce633f6506a2d173a2e')
pkgver() {
cd $pkgname
git describe --tags --long | sed -r 's/^[a-z]*-?//;s/([^-]*-g)/r\1/;s/-/./g'
}
prepare() {
cd "$pkgname"
patch -Np1 -i "${srcdir}/http-parser.patch"
}
build() {
cd $pkgname
make library
}
check() {
cd $pkgname
local CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/}"
make test
}
package() {
cd $pkgname
install -Dm644 LICENSE-MIT \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"
install -Dm644 AUTHORS \
"${pkgdir}/usr/share/doc/${pkgname}/AUTHORS"
install -Dm644 README.md \
"${pkgdir}/usr/share/doc/${pkgname}/README.md"
make DESTDIR="$pkgdir/" PREFIX="/usr" install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment