diff options
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | Makefile.patch | 12 | ||||
-rw-r--r-- | PKGBUILD | 72 | ||||
-rw-r--r-- | install.patch | 65 |
4 files changed, 137 insertions, 45 deletions
@@ -1,18 +1,33 @@ pkgbase = lua-md5 - pkgdesc = Basic cryptographic facilities for Lua. + pkgdesc = Basic cryptographic facilities for Lua pkgver = 1.3 - pkgrel = 1 + pkgrel = 2 url = https://github.com/keplerproject/md5 - arch = i686 arch = x86_64 license = MIT - depends = lua - source = https://github.com/keplerproject/md5/archive/refs/tags/1.3.tar.gz - source = Makefile.patch + makedepends = lua + makedepends = lua51 + makedepends = lua52 + makedepends = lua53 + source = lua-md5-1.3.tar.gz::https://github.com/keplerproject/md5/archive/1.3.tar.gz + source = install.patch source = LICENSE - md5sums = 17b773591141091a4104d5183aad134b - md5sums = 6de2eb1764732e2337be3e163e72b0bd - md5sums = 9ac505254abc686b34763c2118dc2e1b + sha256sums = 0747a88d89c5d9b71e15fd614ac77a027627ce9ed222d3eb9ddee66f9fd46da4 + sha256sums = ef2bb7d67992f5ebcce908d0664cf96015b779d873aec2d29aeb6610bdd525ae + sha256sums = 6b33a65cf51a300efeb5d76afa0d02c25b0c0080afd68a88680cb9ce685fef8d pkgname = lua-md5 + pkgdesc = Basic cryptographic facilities for Lua 5.4 + depends = lua + +pkgname = lua51-md5 + pkgdesc = Basic cryptographic facilities for Lua 5.1 + depends = lua51 + +pkgname = lua52-md5 + pkgdesc = Basic cryptographic facilities for Lua 5.2 + depends = lua52 +pkgname = lua53-md5 + pkgdesc = Basic cryptographic facilities for Lua 5.3 + depends = lua53 diff --git a/Makefile.patch b/Makefile.patch deleted file mode 100644 index e2aa13462407..000000000000 --- a/Makefile.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Makefile.orig 2021-05-24 19:13:11.690356144 +0200 -+++ Makefile 2021-05-24 20:12:51.515333523 +0200 -@@ -22,8 +22,8 @@ - $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(DES56_LIBNAME) $(DES56_OBJS) $(COMPAT52_OBJS) - - install: src/$(MD5_LIBNAME) src/$(DES56_LIBNAME) -- cp src/$(DES56_LIBNAME) $(LUA_LIBDIR) - mkdir -p $(LUA_LIBDIR)/md5 -+ cp src/$(DES56_LIBNAME) $(LUA_LIBDIR) - cp src/$(MD5_LIBNAME) $(LUA_LIBDIR)/md5/ - mkdir -p $(LUA_DIR) - cp $(MD5_LUAS) $(LUA_DIR) @@ -1,38 +1,62 @@ +# Maintainer: Luis Martinez <luis dot martinez at disroot dot org> # Contributor: Daniel J Griffiths <ghost1227@archlinux.us> # Contributor: Bogdan Szczurek <thebodzio@gmail.com> -pkgname=lua-md5 +pkgname=('lua-md5' 'lua51-md5' 'lua52-md5' 'lua53-md5') pkgver=1.3 -pkgrel=1 -pkgdesc="Basic cryptographic facilities for Lua." -arch=('i686' 'x86_64') +pkgrel=2 +pkgdesc="Basic cryptographic facilities for Lua" +arch=('x86_64') url="https://github.com/keplerproject/md5" license=('MIT') -depends=('lua') -source=(https://github.com/keplerproject/md5/archive/refs/tags/${pkgver}.tar.gz - Makefile.patch - LICENSE) +makedepends=('lua' 'lua51' 'lua52' 'lua53') +source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" + install.patch + LICENSE) +sha256sums=('0747a88d89c5d9b71e15fd614ac77a027627ce9ed222d3eb9ddee66f9fd46da4' + 'ef2bb7d67992f5ebcce908d0664cf96015b779d873aec2d29aeb6610bdd525ae' + '6b33a65cf51a300efeb5d76afa0d02c25b0c0080afd68a88680cb9ce685fef8d') prepare() { - cd ${srcdir}/md5-${pkgver} - ./configure - sed -i "s|5.2|$(lua -v | grep -oP '\d\.\d')|" config - patch < ../Makefile.patch + patch -p1 -d "md5-$pkgver" < install.patch + mv "md5-$pkgver" "$pkgname-$pkgver" + for i in 51 52 53; do + cp -a "$pkgname-$pkgver" "${pkgname/lua/lua$i}-$pkgver" + done } -build() { - cd ${srcdir}/md5-${pkgver} - make || return 1 +package_lua-md5() { + pkgdesc="$pkgdesc 5.4" + depends=('lua') + + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + cd "$pkgname-$pkgver" + make install PREFIX=/usr DESTDIR="$pkgdir/" LUA_SYS_VER=5.4 } -package() { - cd ${srcdir}/md5-${pkgver} - sed -i "s|\(PREFIX = \)|\1${pkgdir}|" config - make install || return 1 - install -Dm644 ${srcdir}/LICENSE \ - ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE +package_lua51-md5() { + pkgdesc="$pkgdesc 5.1" + depends=('lua51') + + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + cd "$pkgname-$pkgver" + make install PREFIX=/usr DESTDIR="$pkgdir/" LUA_SYS_VER=5.1 } -md5sums=('17b773591141091a4104d5183aad134b' - '6de2eb1764732e2337be3e163e72b0bd' - '9ac505254abc686b34763c2118dc2e1b') +package_lua52-md5() { + pkgdesc="$pkgdesc 5.2" + depends=('lua52') + + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + cd "$pkgname-$pkgver" + make install PREFIX=/usr DESTDIR="$pkgdir/" LUA_SYS_VER=5.2 +} + +package_lua53-md5() { + pkgdesc="$pkgdesc 5.3" + depends=('lua53') + + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + cd "$pkgname-$pkgver" + make install PREFIX=/usr DESTDIR="$pkgdir/" LUA_SYS_VER=5.3 +} diff --git a/install.patch b/install.patch new file mode 100644 index 000000000000..0e3f9a10077b --- /dev/null +++ b/install.patch @@ -0,0 +1,65 @@ +diff --git a/Makefile b/Makefile +index 2dcc453..35ef065 100644 +--- a/Makefile ++++ b/Makefile +@@ -22,11 +22,9 @@ src/$(DES56_LIBNAME) : $(DES56_OBJS) $(COMPAT52_OBJS) + $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(DES56_LIBNAME) $(DES56_OBJS) $(COMPAT52_OBJS) + + install: src/$(MD5_LIBNAME) src/$(DES56_LIBNAME) +- cp src/$(DES56_LIBNAME) $(LUA_LIBDIR) +- mkdir -p $(LUA_LIBDIR)/md5 +- cp src/$(MD5_LIBNAME) $(LUA_LIBDIR)/md5/ +- mkdir -p $(LUA_DIR) +- cp $(MD5_LUAS) $(LUA_DIR) ++ install -Dm 644 src/$(DES56_LIBNAME) -t $(DESTDIR)/$(LUA_LIBDIR) ++ install -Dm 644 src/$(MD5_LIBNAME) -t $(DESTDIR)/$(LUA_LIBDIR)/md5/ ++ install -Dm 644 $(MD5_LUAS) -t $(DESTDIR)/$(LUA_DIR) + + clean: + rm -f $(MD5_OBJS) src/$(MD5_LIBNAME) $(DES56_OBJS) src/$(DES56_LIBNAME) $(COMPAT52_OBJS) +diff --git a/config b/config +index c06cb5e..bf92807 100644 +--- a/config ++++ b/config +@@ -1,28 +1,32 @@ + # Installation directories + + # Default prefix +-PREFIX = /usr/local ++PREFIX ?= /usr ++ ++# Root prefix ++ ++DESTDIR ?= + + # Lua version + LUA_SYS_VER ?= 5.2 + + # System's libraries directory (where binary libraries are installed) +-LUA_LIBDIR= $(PREFIX)/lib/lua/$(LUA_SYS_VER) ++LUA_LIBDIR = $(PREFIX)/lib/lua/$(LUA_SYS_VER) + + # System's lua directory (where Lua libraries are installed) +-LUA_DIR= $(PREFIX)/share/lua/$(LUA_SYS_VER) ++LUA_DIR = $(PREFIX)/share/lua/$(LUA_SYS_VER) + + # Lua includes directory +-LUA_INC= $(PREFIX)/include ++LUA_INC = $(PREFIX)/include + + # OS dependent +-LIB_OPTION= -shared #for Linux ++LIB_OPTION = -shared #for Linux + #LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X + + # Compilation directives +-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith +-INCS= -I$(LUA_INC) +-CFLAGS= $(WARN) $(INCS) +-CC= gcc ++WARN = -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith ++INCS = -I$(LUA_INC) ++CFLAGS += $(WARN) $(INCS) ++CC ?= cc + + # $Id: config,v 1.6 2007/10/29 23:00:23 carregal Exp $ |