From 4a5bf7cce53d43d6b2213b780a90410fa77b0de2 Mon Sep 17 00:00:00 2001 From: hippoz Date: Thu, 1 Jul 2021 20:57:17 +0300 Subject: [PATCH] convert a couple of packages to the new package system --- autoconf/Makefile | 9 --------- autoconf/PACKAGE | 14 ++++++++++++++ automake/Makefile | 9 --------- automake/PACKAGE | 13 +++++++++++++ bash/Makefile | 9 --------- bash/PACKAGE | 13 +++++++++++++ binutils/{Makefile => PACKAGE} | 22 ++++++++++++++-------- bison/Makefile | 11 ----------- bison/PACKAGE | 15 +++++++++++++++ busybox/Makefile | 11 ----------- busybox/PACKAGE | 14 ++++++++++++++ bzip2/Makefile | 14 -------------- bzip2/PACKAGE | 19 +++++++++++++++++++ curl/Makefile | 11 ----------- curl/PACKAGE | 16 ++++++++++++++++ flex/{Makefile => PACKAGE} | 22 ++++++++++++++-------- gcc/{Makefile => PACKAGE} | 21 +++++++++++++-------- git/Makefile | 9 --------- git/PACKAGE | 13 +++++++++++++ gzip/{Makefile => PACKAGE} | 19 ++++++++++++++----- hummingbird/Makefile | 21 --------------------- hummingbird/PACKAGE | 23 +++++++++++++++++++++++ 22 files changed, 195 insertions(+), 133 deletions(-) delete mode 100644 autoconf/Makefile create mode 100644 autoconf/PACKAGE delete mode 100644 automake/Makefile create mode 100644 automake/PACKAGE delete mode 100644 bash/Makefile create mode 100644 bash/PACKAGE rename binutils/{Makefile => PACKAGE} (62%) delete mode 100644 bison/Makefile create mode 100644 bison/PACKAGE delete mode 100644 busybox/Makefile create mode 100644 busybox/PACKAGE delete mode 100644 bzip2/Makefile create mode 100644 bzip2/PACKAGE delete mode 100644 curl/Makefile create mode 100644 curl/PACKAGE rename flex/{Makefile => PACKAGE} (64%) rename gcc/{Makefile => PACKAGE} (56%) delete mode 100644 git/Makefile create mode 100644 git/PACKAGE rename gzip/{Makefile => PACKAGE} (67%) delete mode 100644 hummingbird/Makefile create mode 100644 hummingbird/PACKAGE diff --git a/autoconf/Makefile b/autoconf/Makefile deleted file mode 100644 index e124cda..0000000 --- a/autoconf/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -prepare: - git clone git://git.sv.gnu.org/autoconf - cd autoconf -autoconf: - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/autoconf/PACKAGE b/autoconf/PACKAGE new file mode 100644 index 0000000..ffd7d01 --- /dev/null +++ b/autoconf/PACKAGE @@ -0,0 +1,14 @@ +#!/bin/sh + +pkg_ver="todo" + +pkg_install() { + git clone git://git.sv.gnu.org/autoconf + cd autoconf + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} \ No newline at end of file diff --git a/automake/Makefile b/automake/Makefile deleted file mode 100644 index ede7302..0000000 --- a/automake/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -prepare: - git clone https://git.savannah.gnu.org/git/auto$(MAKE).git - cd auto$(MAKE) -auto$(MAKE): - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/automake/PACKAGE b/automake/PACKAGE new file mode 100644 index 0000000..66651c2 --- /dev/null +++ b/automake/PACKAGE @@ -0,0 +1,13 @@ +#!/bin/sh +pkg_ver="todo" + +pkg_install() { + git clone https://git.savannah.gnu.org/git/automake.git + cd automake + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} diff --git a/bash/Makefile b/bash/Makefile deleted file mode 100644 index 3dfa184..0000000 --- a/bash/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -prepare: - git clone https://git.savannah.gnu.org/git/bash.git - cd bash -bash: - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/bash/PACKAGE b/bash/PACKAGE new file mode 100644 index 0000000..eccf426 --- /dev/null +++ b/bash/PACKAGE @@ -0,0 +1,13 @@ +#!/bin/sh +pkg_ver="todo" + +pkg_install() { + git clone https://git.savannah.gnu.org/git/bash.git + cd bash + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} \ No newline at end of file diff --git a/binutils/Makefile b/binutils/PACKAGE similarity index 62% rename from binutils/Makefile rename to binutils/PACKAGE index 4e15894..61c7601 100644 --- a/binutils/Makefile +++ b/binutils/PACKAGE @@ -1,9 +1,12 @@ -prepare: +#!/bin/sh +pkg_ver="2.10.1" + +pkg_install() { wget -O binutils.tar.gz https://mirrors.nav.ro/gnu/binutils/binutils-2.10.1.tar.gz tar -xf binutils.tar.gz cd binutils -$(MAKE): - @../configure --prefix=/usr \ + + ../configure --prefix=/usr \ --enable-gold \ --enable-ld=default \ --enable-plugins \ @@ -11,8 +14,11 @@ $(MAKE): --disable-werror \ --enable-64-bit-bfd \ --with-system-zlib - $(MAKE) tooldir=${PREFIX}/usr -install: - $(MAKE) install tooldir=${PREFIX}/usr DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall + + make tooldir=/usr + make install tooldir=/usr DESTDIR=$1 +} + +pkg_uninstall() { + make uninstall +} diff --git a/bison/Makefile b/bison/Makefile deleted file mode 100644 index c59e1ed..0000000 --- a/bison/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -prepare: - wget -O bison.tar.gz https://mirrors.nav.ro/gnu/bison/bison-1.25.tar.gz - tar -xf bison.tar.gz - cd bison -$(MAKE): - @./configure --prefix=/usr - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/bison/PACKAGE b/bison/PACKAGE new file mode 100644 index 0000000..97732c1 --- /dev/null +++ b/bison/PACKAGE @@ -0,0 +1,15 @@ +#!/bin/sh +pkg_ver="1.25" + +pkg_install() { + wget -O bison.tar.gz https://mirrors.nav.ro/gnu/bison/bison-1.25.tar.gz + tar -xf bison.tar.gz + cd bison + ./configure --prefix=/usr + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} diff --git a/busybox/Makefile b/busybox/Makefile deleted file mode 100644 index 144cbb0..0000000 --- a/busybox/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -prepare: - git clone git://busybox.net/busybox.git - cd busybox -busybox: - $(MAKE) defconfig - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" - busybox --install -uninstall: - $(MAKE) uninstall diff --git a/busybox/PACKAGE b/busybox/PACKAGE new file mode 100644 index 0000000..bb0467c --- /dev/null +++ b/busybox/PACKAGE @@ -0,0 +1,14 @@ +#!/bin/sh +pkg_ver="todo" + +pkg_install() { + git clone git://busybox.net/busybox.git + cd busybox + make defconfig + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} diff --git a/bzip2/Makefile b/bzip2/Makefile deleted file mode 100644 index cdce70d..0000000 --- a/bzip2/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -prepare: - git clone https://www.sourceware.org/pub/bzip2/bzip2-latest.tar.gz bzip2 - cd bzip2 -$(MAKE): - $(MAKE) -f Makefile-libbz2_so - $(MAKE) clean - $(MAKE) -install: - $(MAKE) PREFIX=${PREFIX}/tools install - cp -v bzip2-shared ${PREFIX}/tools/bin/bzip2 - cp -av libbz2.so* ${PREFIX}/tools/lib - ln -sv libbz2.so.1.0 ${PREFIX}/tools/lib/libbz2.so -uninstall: - $(MAKE) uninstall diff --git a/bzip2/PACKAGE b/bzip2/PACKAGE new file mode 100644 index 0000000..79abb70 --- /dev/null +++ b/bzip2/PACKAGE @@ -0,0 +1,19 @@ +#!/bin/sh +pkg_ver="todo" + +pkg_install() { + git clone https://www.sourceware.org/pub/bzip2/bzip2-latest.tar.gz bzip2 + cd bzip2 + make -f Makefile-libbz2_so + make clean + make + + make PREFIX=$1/tools install + cp -v bzip2-shared $1/tools/bin/bzip2 + cp -av libbz2.so* $1/tools/lib + ln -sv libbz2.so.1.0 $1/tools/lib/libbz2.so +} + +pkg_uninstall() { + make uninstall +} diff --git a/curl/Makefile b/curl/Makefile deleted file mode 100644 index 987172e..0000000 --- a/curl/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -prepare: - wget -O curl.tar.gz https://curl.se/download/curl-7.77.0.tar.gz - tar -xf curl.tar.gz - cd curl -$(MAKE): - @./configure --prefix=/usr --with-openssl - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/curl/PACKAGE b/curl/PACKAGE new file mode 100644 index 0000000..e82f5c2 --- /dev/null +++ b/curl/PACKAGE @@ -0,0 +1,16 @@ +#!/bin/sh +pkg_ver="7.77.0" +pkg_depends="openssl" + +pkg_install() { + wget -O curl.tar.gz https://curl.se/download/curl-7.77.0.tar.gz + tar -xf curl.tar.gz + cd curl + ./configure --prefix=/usr --with-openssl + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} diff --git a/flex/Makefile b/flex/PACKAGE similarity index 64% rename from flex/Makefile rename to flex/PACKAGE index f6ea3d4..b88a8b3 100644 --- a/flex/Makefile +++ b/flex/PACKAGE @@ -1,16 +1,22 @@ -prepare: +#!/bin/sh +pkg_ver="2.6.4" + +pkg_install() { wget -O flex.tar.gz https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz tar -xf flex.tar.gz cd flex -$(MAKE): - @./configure \ + + ./configure \ --prefix=/usr \ ac_cv_func_malloc_0_nonnull=yes \ ac_cv_func_realloc_0_nonnull=yes - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" + make + make install DESTDIR="$1" ln -s flex "$1/usr/bin/lex" -uninstall: - $(MAKE) uninstall +} + +pkg_uninstall() { + make uninstall +} + diff --git a/gcc/Makefile b/gcc/PACKAGE similarity index 56% rename from gcc/Makefile rename to gcc/PACKAGE index 4db21f1..d6b878a 100644 --- a/gcc/Makefile +++ b/gcc/PACKAGE @@ -1,16 +1,21 @@ -prepare: +#!/bin/sh +pkg_ver="todo" + +pkg_install() { git clone git://gcc.gnu.org/git/gcc.git cd gcc -gcc: + sed -i '/m64=/s/lib64/lib/' gcc/gcc/config/i386/t-linux64 sed -i 's/lib64/lib/' gcc/gcc/config/i386/linux64.h mkdir build cd build - ./configure --prefix=${PREFIX}/usr --enable-languages=c,c++,d,fortran,go,objc,obj-c++ - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" + ./configure --prefix=/usr --enable-languages=c,c++,d,fortran,go,objc,obj-c++ + make + make install DESTDIR="$1" ln -s gcc "$1/usr/bin/cc" install -Dm755 ../c99 "$1/usr/bin/c99" -uninstall: - rm -rf /usr/bin/gcc +} + +pkg_uninstall() { + make uninstall +} diff --git a/git/Makefile b/git/Makefile deleted file mode 100644 index 5c06c15..0000000 --- a/git/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -prepare: - git clone git://git.kernel.org/pub/scm/git/git.git - cd git -git: - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" -uninstall: - $(MAKE) uninstall diff --git a/git/PACKAGE b/git/PACKAGE new file mode 100644 index 0000000..c02a3cc --- /dev/null +++ b/git/PACKAGE @@ -0,0 +1,13 @@ +#!/bin/sh +pkgver="todo" + +pkg_install() { + git clone git://git.kernel.org/pub/scm/git/git.git + cd git + make + make install DESTDIR="$1" +} + +pkg_uninstall() { + make uninstall +} diff --git a/gzip/Makefile b/gzip/PACKAGE similarity index 67% rename from gzip/Makefile rename to gzip/PACKAGE index 91b932f..3531ee6 100644 --- a/gzip/Makefile +++ b/gzip/PACKAGE @@ -1,11 +1,14 @@ +#!/bin/sh +pkgver="todo" + +pkg_install() { prepare: git clone https://git.savannah.gnu.org/git/gzip.git/ cd gzip -$(MAKE): - ./configure --prefix=$prefix/usr --host=$LFS_TGT - $(MAKE) CC="${CC:-cc} -static" -install: - $(MAKE) DESTDIR=$LFS install + ./configure --prefix=$1/usr --host=$1 + make CC="${CC:-cc} -static" + make DESTDIR=$1 install + install -Dm755 pigz "$1/usr/bin/pigz" install -Dm755 unpigz "$1/usr/bin/unpigz" install -Dm644 pigz.1 "$1/usr/share/man/man1/pigz.1" @@ -13,3 +16,9 @@ install: ln -sf pigz "$1/usr/bin/zcat" ln -sf unpigz "$1/usr/bin/gunzip" ln -sf pigz.1 "$1/usr/share/man/man1/gzip.1" + +} + +pkg_uninstall() { + make uninstall +} diff --git a/hummingbird/Makefile b/hummingbird/Makefile deleted file mode 100644 index 0f44264..0000000 --- a/hummingbird/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -prepare: - git clone https://github.com/Sweets/hummingbird hummingbird - cd hummingbird - wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/fs - wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/interlude - wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/shutdown - wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/tty -$(MAKE): - $(MAKE) -install: - $(MAKE) install DESTDIR="${PREFIX}" - - mv fs ${PREFIX}/usr/bin/hummingbird/ - mv interlude ${PREFIX}/usr/bin/hummingbird/ - mv shutdown ${PREFIX}/usr/bin/hummingbird/ - mv tty ${PREFIX}/usr/bin/hummingbird/ - chmod +x ${PREFIX}/usr/bin/hummingbird/* -uninstall: - @echo "pkgmsg: hummingbird does not have a proper uninstall script" - # we would need to rm -rf ${PREFIX}/usr/lib/hummingbird - # and rm $(INSTALL) hummingbird "$(DESTDIR)/usr/bin/hummingbird" "$(DESTDIR)/usr/bin/shutdown" "$(DESTDIR)/usr/bin/reboot" diff --git a/hummingbird/PACKAGE b/hummingbird/PACKAGE new file mode 100644 index 0000000..aa688e6 --- /dev/null +++ b/hummingbird/PACKAGE @@ -0,0 +1,23 @@ +#!/bin/sh +pkg_ver="todo" + +pkg_install() { + git clone https://github.com/Sweets/hummingbird hummingbird + cd hummingbird + wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/fs + wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/interlude + wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/shutdown + wget https://git.hippoz.xyz/alnux/repo/src/branch/master/hummingbird/payload/usr/lib/hummingbird/tty + make + make install DESTDIR="$1" + + mv fs $1/usr/bin/hummingbird/ + mv interlude $1/usr/bin/hummingbird/ + mv shutdown $1/usr/bin/hummingbird/ + mv tty $1/usr/bin/hummingbird/ + chmod +x $1/usr/bin/hummingbird/* +} + +pkg_uninstall() { + # TODO +}