]> gitweb.fluxo.info Git - trashman.git/commitdiff
Fix: xbps: make more generic
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 16 Aug 2020 12:03:50 +0000 (09:03 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 16 Aug 2020 12:03:50 +0000 (09:03 -0300)
share/hoarder/xbps/unix/linux/debian/install
share/trashman/xbps/functions [new file with mode: 0644]
share/trashman/xbps/unix/linux/debian/install

index a6fc2562b7feae4eefa342d7a57f3a07fd946f3b..76d0e1ef0c903912b6221d4d58e2b29c28365af4 100755 (executable)
@@ -7,24 +7,15 @@
 SHARE="$1"
 LIB="$2"
 DESTDIR="$HOME/.xbps"
+SRC="$HOME/.local/src"
+#FLAGS="--enable-rpath"
+FLAGS=""
 
 # Include basic functions
 . $LIB/trashman/functions || exit 1
 . $LIB/trashman/debian    || exit 1
+. $LIB/xbps/functions     || exit 1
 
-# Requirements
-trashman_apt_install make gcc zlib1g-dev pkg-config libarchive-dev graphviz doxygen
-#trashman_apt_install atf-sh
-
-# Source folder
-mkdir -p $HOME/.local/src
-
-# Build and install
-git clone https://github.com/void-linux/xbps $HOME/.local/src/xbps     || exit 1
-cd $HOME/.local/src/xbps                                               || exit 1
-./configure --enable-rpath --prefix=$DESTDIR --sysconfdir=$DESTDIR/etc || exit 1
-make -j$(nproc)                                                        || exit 1
-make DESTDIR=$DESTDIR install clean                                    || exit 1
-
-# Remove source
-#rm -rf $HOME/.local/src/xbps
+# Install
+xbps_debian_requirements
+xbps_install
diff --git a/share/trashman/xbps/functions b/share/trashman/xbps/functions
new file mode 100644 (file)
index 0000000..b1d2814
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# xbps basic functions.
+#
+
+xbps_debian_requirements() {
+  # Requirements
+  trashman_apt_install make gcc zlib1g-dev pkg-config libarchive-dev graphviz doxygen libssl-dev
+  #trashman_apt_install atf-sh
+}
+
+xbps_install() {
+  # Source folder
+  mkdir -p $SRC
+  
+  # Download
+  if [ -d "$SRC/xbps" ]; then
+    cd $SRC/xbps && git pull
+  else
+    git clone https://github.com/void-linux/xbps $SRC/xbps || exit 1
+  fi
+  
+  # Build and install
+  cd $SRC/xbps                                                   || exit 1
+  ./configure $FLAGS --prefix=$DESTDIR --sysconfdir=$DESTDIR/etc || exit 1
+  make -j$(nproc)                                                || exit 1
+  make DESTDIR=$DESTDIR install clean                            || exit 1
+  
+  # Remove source
+  #rm -rf $HOME/.local/src/xbps
+}
index 5921585566f443b855ef11c95f139666dedaddc8..1d5c4c22c45263291ed834d90c7e1e52bf560b1b 100755 (executable)
@@ -7,24 +7,14 @@
 SHARE="$1"
 BASE="$SHARE/../.."
 DESTDIR="/usr/local"
+SRC="$DESTDIR/src"
+FLAGS=""
 
 # Include basic functions
 . $SHARE/trashman/functions || exit 1
 . $SHARE/trashman/debian    || exit 1
+. $SHARE/xbps/functions     || exit 1
 
-# Requirements
-trashman_apt_install make gcc zlib1g-dev pkg-config libarchive-dev graphviz doxygen
-#trashman_apt_install atf-sh
-
-# Source folder
-mkdir -p $DESTDIR/src
-
-# Build and install
-git clone https://github.com/void-linux/xbps $DESTDIR/src/xbps         || exit 1
-cd $DESTDIR/src/xbps                                                   || exit 1
-./configure --enable-rpath --prefix=$DESTDIR --sysconfdir=$DESTDIR/etc || exit 1
-make -j$(nproc)                                                        || exit 1
-make DESTDIR=$DESTDIR install clean                                    || exit 1
-
-# Remove source
-#rm -rf $HOME/.local/src/xbps
+# Install
+xbps_debian_requirements
+xbps_install