Permalink
Browse files

Add a new "mkports.sh" helper script, which will convert the git tree…

… into

the pcbsd-utils & pcbsd-utils-qt4 ports.

While here, convert the pcbsd-utils port to use STAGING
  • Loading branch information...
1 parent 55ea386 commit c60c60450ce0eb946fe414172941d586e8b71757 @kmoore134 kmoore134 committed Sep 26, 2013
Showing with 353 additions and 212 deletions.
  1. +73 −0 mkports.sh
  2. +1 −0 src-sh/Makefile
  3. +7 −7 src-sh/about/Makefile
  4. +10 −10 src-sh/de-info/Makefile
  5. +7 −6 src-sh/libsh/Makefile
  6. +3 −1 src-sh/lpreserver/Makefile
  7. +10 −3 src-sh/lpreserver/install.sh
  8. +3 −1 src-sh/pbi-manager/Makefile
  9. +14 −16 src-sh/pbi-manager/install.sh
  10. +5 −1 src-sh/pbi-manager/pbi-manager
  11. +2 −7 src-sh/pbi-manager/wrapper/Makefile
  12. +3 −1 src-sh/pbi-manager10/Makefile
  13. +7 −6 src-sh/pbreg/Makefile
  14. +3 −1 src-sh/pc-adctl/bin/Makefile
  15. +2 −1 src-sh/pc-adctl/conf/Makefile
  16. +2 −1 src-sh/pc-adctl/pc-krbconf/Makefile
  17. +2 −1 src-sh/pc-adctl/pc-ldapconf/Makefile
  18. +2 −1 src-sh/pc-adctl/pc-nssconf/Makefile
  19. +2 −1 src-sh/pc-adctl/pc-nssldapconf/Makefile
  20. +2 −1 src-sh/pc-adctl/pc-pamconf/Makefile
  21. +2 −1 src-sh/pc-adctl/pc-sambaconf/Makefile
  22. +2 −1 src-sh/pc-adctl/rc/Makefile
  23. +2 −1 src-sh/pc-adctl/scripts/Makefile
  24. +7 −6 src-sh/pc-checkxdisplay/Makefile
  25. +3 −1 src-sh/pc-extractoverlay/Makefile
  26. +21 −13 src-sh/pc-extractoverlay/install.sh
  27. +6 −7 src-sh/pc-fbsdupdatecheck/Makefile
  28. +8 −6 src-sh/pc-firstgui/Makefile
  29. +12 −10 src-sh/pc-metapkgmanager/Makefile
  30. +8 −6 src-sh/pc-runxgui/Makefile
  31. +8 −7 src-sh/pc-su/Makefile
  32. +2 −1 src-sh/pc-sysinstall/Makefile
  33. +4 −2 src-sh/pc-sysinstall/install.sh
  34. +12 −10 src-sh/pc-thinclient/Makefile
  35. +12 −10 src-sh/pc-updatemanager/Makefile
  36. +17 −17 src-sh/pc-xdgutil/Makefile
  37. +2 −15 src-sh/port-files/Makefile
  38. +6 −0 src-sh/port-files/pkg-install
  39. +21 −15 src-sh/port-files/pkg-plist
  40. +3 −1 src-sh/warden/Makefile
  41. +23 −14 src-sh/warden/install.sh
  42. +3 −1 src-sh/xtrafiles/Makefile
  43. +9 −1 src-sh/xtrafiles/install.sh
View
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Helper script which will create the port / distfiles
+# from a checked out git repo
+
+# Set the distfile URL we will fetch from
+DURL="http://www.pcbsd.org/~kris/software/"
+
+get_last_rev_git()
+{
+ oPWD=`pwd`
+ cd "${1}"
+ rev=0
+ rev=`git log -n 1 --date=raw | grep 'Date:' | awk '{print $2}'`
+ cd $oPWD
+ if [ $rev -ne 0 ] ; then
+ echo "$rev"
+ return 0
+ fi
+ return 1
+}
+
+if [ -z "$1" ] ; then
+ echo "Usage: ./mkports.sh <outdir>"
+ exit 1
+fi
+
+if [ ! -d "${1}" ] ; then
+ echo "Invalid directory: $1"
+ exit 1
+fi
+
+portsdir="${1}"
+distdir="${1}/distfiles"
+if [ ! -d "$portsdir" ] ; then
+ mkdir ${portsdir}
+fi
+if [ ! -d "$portsdir/sysutils" ] ; then
+ mkdir ${portsdir}/sysutils
+fi
+if [ ! -d "$distdir" ] ; then
+ mkdir ${distdir}
+fi
+
+cliREV=`get_last_rev_git "./src-sh"`
+guiREV=`get_last_rev_git "./src-qt4"`
+
+# Make the dist files
+rm ${distdir}/pcbsd-utils*.tar.bz2 2>/dev/null
+echo "Creating pcbsd-utils dist file for version: $cliREV"
+tar cvjf ${distdir}/pcbsd-utils-${cliREV}.tar.bz2 src-sh 2>/dev/null
+echo "Creating pcbsd-utils-qt4 dist file for version: $guiREV"
+tar cvjf ${distdir}/pcbsd-utils-qt4-${guiREV}.tar.bz2 src-qt4 2>/dev/null
+
+# Copy ports files
+rm -rf ${portsdir}/sysutils/pcbsd-utils 2>/dev/null
+rm -rf ${portsdir}/sysutils/pcbsd-utils-qt4 2>/dev/null
+cp -r src-sh/port-files ${portsdir}/sysutils/pcbsd-utils
+cp -r src-qt4/port-files ${portsdir}/sysutils/pcbsd-utils-qt4
+
+# Set the version numbers
+sed -i '' "s|CHGVERSION|${cliREV}|g" ${portsdir}/sysutils/pcbsd-utils/Makefile
+sed -i '' "s|CHGVERSION|${guiREV}|g" ${portsdir}/sysutils/pcbsd-utils-qt4/Makefile
+
+# Set the mirror to use
+sed -i '' "s|http://www.pcbsd.org/~kris/software/|${DURL}|g" ${portsdir}/sysutils/pcbsd-utils/Makefile
+sed -i '' "s|http://www.pcbsd.org/~kris/software/|${DURL}|g" ${portsdir}/sysutils/pcbsd-utils-qt4/Makefile
+
+# Create the makesums / distinfo file
+cd ${distdir}
+sha256 pcbsd-utils-${cliREV}.tar.bz2 > ${portsdir}/sysutils/pcbsd-utils/distinfo
+echo "SIZE (pcbsd-utils-${cliREV}.tar.bz2) = `stat -f \"%z\" pcbsd-utils-${cliREV}.tar.bz2`" >> ${portsdir}/sysutils/pcbsd-utils/distinfo
+sha256 pcbsd-utils-qt4-${guiREV}.tar.bz2 > ${portsdir}/sysutils/pcbsd-utils-qt4/distinfo
+echo "SIZE (pcbsd-utils-qt4-${guiREV}.tar.bz2) = `stat -f \"%z\" pcbsd-utils-qt4-${guiREV}.tar.bz2`" >> ${portsdir}/sysutils/pcbsd-utils-qt4/distinfo
View
@@ -19,6 +19,7 @@ DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
+PREFIX?= $(STAGEDIR)/usr/local
SUBTARGETS = \
sub-libsh \
sub-lpreserver \
View
@@ -4,8 +4,8 @@
####### Compiler, tools and options
+PREFIX?= /usr/local
AR = ar cqs
-QMAKE = /usr/local/bin/qmake-qt4
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
@@ -31,18 +31,18 @@ clean:
check: first
install_scripts: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
- -$(INSTALL_FILE) about $(INSTALL_ROOT)/usr/local/bin/
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/bin/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/bin/
+ -$(INSTALL_FILE) about $(INSTALL_ROOT)$(PREFIX)/bin/
uninstall_scripts: FORCE
- -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/bin/about
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/
+ -$(DEL_FILE) -r $(INSTALL_ROOT)$(PREFIX)/bin/about
+ -$(DEL_DIR) $(INSTALL_ROOT)$(PREFIX)/bin/
install_dochmod: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
- chmod 755 /usr/local/bin/about
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/bin/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/bin/
+ chmod 755 $(PREFIX)/bin/about
install: install_scripts install_dochmod FORCE
View
@@ -3,7 +3,7 @@
#############################################################################
####### Compiler, tools and options
-
+PREFIX?= /usr/local
AR = ar cqs
RANLIB =
TAR = tar -cf
@@ -30,23 +30,23 @@ all: Makefile $(TARGET)
check: first
install_scripts: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
- -$(INSTALL_FILE) de-info $(INSTALL_ROOT)/usr/local/bin/
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/bin/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/bin/
+ -$(INSTALL_FILE) de-info $(INSTALL_ROOT)$(PREFIX)/bin/
uninstall_scripts: FORCE
- -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/bin/de-info
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/
+ -$(DEL_FILE) -r $(INSTALL_ROOT)$(PREFIX)/bin/de-info
+ -$(DEL_DIR) $(INSTALL_ROOT)$(PREFIX)/bin/
install_dochmod: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
- chmod 755 /usr/local/bin/de-info
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/bin/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/bin/
+ chmod 755 $(PREFIX)/bin/de-info
install_ddirs: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/share/pcbsd/de-profiles/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/share/pcbsd/de-profiles/
- -$(INSTALL_DIR) de-profiles $(INSTALL_ROOT)/usr/local/share/pcbsd
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/de-profiles/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/de-profiles/
+ -$(INSTALL_DIR) de-profiles $(INSTALL_ROOT)$(PREFIX)/share/pcbsd
uninstall_ddirs: FORCE
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/share/pcbsd/de-profiles/
+ -$(DEL_DIR) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/de-profiles/
install: install_scripts install_dochmod install_ddirs FORCE
View
@@ -4,6 +4,7 @@
####### Compiler, tools and options
+PREFIX?= /usr/local
AR = ar cqs
TAR = tar -cf
COMPRESS = gzip -9f
@@ -30,18 +31,18 @@ clean:
check: first
install_scripts: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/
- -$(INSTALL_FILE) functions.sh $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/
+ -$(INSTALL_FILE) functions.sh $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/
uninstall_scripts: FORCE
- -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/functions.sh
- -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts
+ -$(DEL_FILE) -r $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/functions.sh
+ -$(DEL_DIR) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts
install_dochmod: first FORCE
- @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/share/pcbsd/scripts/
- chmod 755 /usr/local/share/pcbsd/scripts/functions.sh
+ @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/ || $(MKDIR) $(INSTALL_ROOT)$(PREFIX)/share/pcbsd/scripts/
+ chmod 755 $(PREFIX)/share/pcbsd/scripts/functions.sh
install: install_scripts install_dochmod FORCE
@@ -4,9 +4,11 @@
####### Install
+PREFIX?= /usr/local
+
all:
install_doinstall:
- sh install.sh
+ sh install.sh $(PREFIX)
install: install_doinstall
@@ -1,14 +1,21 @@
#!/bin/sh
+
+if [ -z "$1" ] ; then
+ STAGEDIR="/usr/local"
+else
+ STAGEDIR="$1"
+fi
+
# lpreserver install script
-PROGDIR="/usr/local/share/lpreserver"
+PROGDIR="${STAGEDIR}/share/lpreserver"
mkdir -p ${PROGDIR} >/dev/null 2>/dev/null
DIR=`dirname $0`
cd ${DIR}
-cp lpreserver /usr/local/bin/lpreserver
-chmod 755 /usr/local/bin/lpreserver
+cp lpreserver ${STAGEDIR}/bin/lpreserver
+chmod 755 ${STAGEDIR}/bin/lpreserver
if [ -d "${PROGDIR}/backend" ] ; then
rm -rf ${PROGDIR}/backend
@@ -2,11 +2,13 @@
# Makefile for building: pbi-manager
#############################################################################
+PREFIX?= $(STAGEDIR)
+
####### Install
all:
install_doinstall:
- sh install.sh
+ sh install.sh $(PREFIX)
install: install_doinstall
@@ -52,22 +52,22 @@ mkdir -p ${LB}/man/man1 >/dev/null 2>/dev/null
for i in `ls man1/`
do
rm ${LB}/man/man1/${i}.gz >/dev/null 2>/dev/null
- cp man1/${i} ${LB}/man/man1/${i}
+ gzip -c man1/${i} > ${LB}/man/man1/${i}.gz
done
mkdir -p ${LB}/man/man5 >/dev/null 2>/dev/null
for i in `ls man5/`
do
rm ${LB}/man/man5/${i}.gz >/dev/null 2>/dev/null
- cp man5/${i} ${LB}/man/man5/${i}
+ gzip -c man5/${i} > ${LB}/man/man5/${i}.gz
done
mkdir -p ${LB}/man/man8 >/dev/null 2>/dev/null
for i in `ls man8/`
do
rm ${LB}/man/man8/${i}.gz >/dev/null 2>/dev/null
- cp man8/${i} ${LB}/man/man8/${i}
+ gzip -c man8/${i} > ${LB}/man/man8/${i}.gz
done
if [ -d "${LB}/share/pbi-manager" ] ; then rm -rf "${LB}/share/pbi-manager" ; fi
@@ -82,9 +82,9 @@ cp ${DIR}/icons/default.png ${LB}/share/pbi-manager/icons
cp ${DIR}/icons/patch.png ${LB}/share/pbi-manager/icons
# If this is a new install, add the PC-BSD master repo
-if [ ! -d "/var/db/pbi/keys" ] ; then
- pbi_addrepo ${DIR}/repo/pcbsd.rpo
-fi
+#if [ ! -d "/var/db/pbi/keys" ] ; then
+# pbi_addrepo ${DIR}/repo/pcbsd.rpo
+#fi
# Copy the default PC-BSD repo file
cp ${DIR}/repo/pcbsd.rpo ${LB}/share/pbi-manager/pcbsd.rpo
@@ -96,20 +96,18 @@ ${LB}/sbin/pbi_info >/dev/null 2>/dev/null
cp ${DIR}/rc.d/pbid ${LB}/etc/rc.d/pbid
cp ${DIR}/etc/pbi.conf ${LB}/etc/pbi.conf
-if [ ! -d "/usr/pbi" ] ; then mkdir /usr/pbi ; fi
-
# Create the wrapper binary
cd ${DIR}/wrapper
if [ `uname -m` = "amd64" ] ; then
# Build 32bit wrapper
echo "Building i386 wrapper..."
- rm .pbiwrapper >/dev/null 2>/dev/null
+ rm pbiwrapper >/dev/null 2>/dev/null
make clean
make DEFINES="-mtune=i386 -march=i386 -m32"
make install
- chown root:wheel /usr/pbi/.pbiwrapper
- chmod 644 /usr/pbi/.pbiwrapper
- mv /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-i386
+ chown root:wheel pbiwrapper
+ chmod 644 pbiwrapper
+ mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-i386
else
touch ${LB}/share/pbi-manager/.pbiwrapper-i386
fi
@@ -118,10 +116,10 @@ fi
echo "Building `uname -m` wrapper..."
DEFINES=""
export DEFINES
-rm .pbiwrapper >/dev/null 2>/dev/null
+rm pbiwrapper >/dev/null 2>/dev/null
make clean
make DEFINES=""
make install DEFINES=""
-chown root:wheel /usr/pbi/.pbiwrapper
-chmod 644 /usr/pbi/.pbiwrapper
-mv /usr/pbi/.pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m`
+chown root:wheel pbiwrapper
+chmod 644 pbiwrapper
+mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m`
@@ -7516,7 +7516,11 @@ getZFSTank() {
}
# Source our shared PCBSD functions
-. /usr/local/share/pcbsd/scripts/functions.sh
+if [ -z "$ALTPROGPREFIX" ] ; then
+ . ${ALTPROGPREFIX}/share/pcbsd/scripts/functions.sh
+else
+ . /usr/local/share/pcbsd/scripts/functions.sh
+fi
# Set the default umask
umask 022
@@ -14,7 +14,6 @@ LFLAGS = -Wl,-O1 $(DEFINES)
LIBS = $(SUBLIBS)
AR = ar cqs
RANLIB =
-QMAKE = /usr/local/bin/qmake-qt4
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
@@ -40,9 +39,8 @@ OBJECTS_DIR = ./
SOURCES = main.c
OBJECTS = main.o
-MAKE_TARGET = .pbiwrapper
-DESTDIR = /usr/pbi/
-TARGET = .pbiwrapper
+MAKE_TARGET = pbiwrapper
+TARGET = pbiwrapper
first: all
####### Implicit rules
@@ -69,7 +67,6 @@ first: all
all: Makefile $(TARGET)
$(TARGET): $(OBJECTS)
- @$(CHK_DIR_EXISTS) /usr/pbi/ || $(MKDIR) /usr/pbi/
$(CC) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile:
@@ -124,8 +121,6 @@ main.o: main.c
####### Install
install_scripts: first FORCE
- -@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/pbi || $(MKDIR) $(INSTALL_ROOT)/usr/pbi/
- -$(INSTALL_FILE) .pbiwrapper $(INSTALL_ROOT)/usr/pbi/.pbiwrapper
install: FORCE install_scripts
@@ -2,11 +2,13 @@
# Makefile for building: pbi-manager
#############################################################################
+PREFIX?= /usr/local
+
####### Install
all:
install_doinstall:
- sh install.sh
+ sh install.sh $(PREFIX)
install: install_doinstall
Oops, something went wrong.

0 comments on commit c60c604

Please sign in to comment.