forked from mirrored-repos/manjaro-tools
changes to makefile and dir structure
This commit is contained in:
parent
c70e67a89f
commit
b531182c54
4 changed files with 39 additions and 153 deletions
56
Makefile
56
Makefile
|
@ -1,22 +1,24 @@
|
|||
V=20141001
|
||||
V=20141004
|
||||
|
||||
PREFIX = /usr/local
|
||||
|
||||
BINPROGS = \
|
||||
bin/checkpkg \
|
||||
bin/manjarobuild \
|
||||
bin/lddd \
|
||||
bin/finddeps \
|
||||
bin/find-libdeps \
|
||||
bin/signpkg \
|
||||
bin/signpkgs \
|
||||
bin/mkmanjaroroot \
|
||||
bin/makechrootpkg \
|
||||
bin/mkchroot \
|
||||
bin/mkchrootpkg \
|
||||
bin/build-set \
|
||||
bin/build-set-helper
|
||||
bin/build-set-helper \
|
||||
basestrap \
|
||||
manjaro-chroot \
|
||||
fstabgen
|
||||
|
||||
SYSCONFIGFILES = \
|
||||
conf/devtools.conf
|
||||
conf/manjaro-tools.conf
|
||||
|
||||
SETS = \
|
||||
sets/default.set \
|
||||
|
@ -31,13 +33,24 @@ CONFIGFILES = \
|
|||
conf/pacman-default.conf \
|
||||
conf/pacman-mirrors.conf \
|
||||
conf/pacman-multilib.conf
|
||||
LIBS = \
|
||||
lib/functions.sh
|
||||
|
||||
|
||||
all: $(BINPROGS)
|
||||
|
||||
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g" \
|
||||
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/devtools|g"
|
||||
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
|
||||
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/manjaro-tools|g" \
|
||||
-e "s|@libdir[@]|$(DESTDIR)$(PREFIX)/lib/manjaro-tools|g"
|
||||
|
||||
%: bin/%.in Makefile lib/common.sh
|
||||
# %: bin/%.in Makefile lib/common.sh
|
||||
# @echo "GEN $@"
|
||||
# @$(RM) "$@"
|
||||
# @m4 -P $@.in | $(edit) >$@
|
||||
# @chmod a-w "$@"
|
||||
# @chmod +x "$@"
|
||||
|
||||
%: %.in Makefile
|
||||
@echo "GEN $@"
|
||||
@$(RM) "$@"
|
||||
@m4 -P $@.in | $(edit) >$@
|
||||
|
@ -48,25 +61,28 @@ clean:
|
|||
rm -f $(BINPROGS)
|
||||
|
||||
install:
|
||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/devtools
|
||||
install -m0644 ${SYSCONFIGFILES} $(DESTDIR)$(SYSCONFDIR)/devtools
|
||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/devtools/sets
|
||||
install -m0644 ${SETS} $(DESTDIR)$(SYSCONFDIR)/devtools/sets
|
||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
|
||||
install -m0644 ${SYSCONFIGFILES} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
|
||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets
|
||||
install -m0644 ${SETS} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets
|
||||
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
||||
install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools
|
||||
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
|
||||
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
|
||||
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
|
||||
install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools
|
||||
install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/manjaro-tools
|
||||
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||
install -m0644 ${LIBS} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
|
||||
|
||||
uninstall:
|
||||
for f in ${SYSCONFIGFILES}; do rm -f $(DESTDIR)$(SYSCONFDIR)/devtools/$$f; done
|
||||
for f in ${SETS}; do rm -f $(DESTDIR)$(SYSCONFDIR)/devtools/sets/$$f; done
|
||||
for f in ${SYSCONFIGFILES}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/$$f; done
|
||||
for f in ${SETS}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets/$$f; done
|
||||
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
||||
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done
|
||||
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
|
||||
|
||||
dist:
|
||||
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
|
||||
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
||||
git archive --format=tar --prefix=manjaro-tools-$(V)/ $(V) | gzip -9 > manjaro-tools-$(V).tar.gz
|
||||
gpg --detach-sign --use-agent manjaro-tools-$(V).tar.gz
|
||||
|
||||
.PHONY: all clean install uninstall dist
|
||||
|
|
2
PKGBUILD
2
PKGBUILD
|
@ -9,6 +9,8 @@ license=('GPL')
|
|||
url='http://git.manjaro.org/core/devtools/'
|
||||
depends=('namcap' 'openssh' 'subversion' 'rsync')
|
||||
provides=('devtools')
|
||||
conflicts=('devtools')
|
||||
replaces=('devtools')
|
||||
backup=('etc/devtools/devtools.conf')
|
||||
source=("git+https://github.com/udeved/manjaro-tools.git")
|
||||
sha256sums=('SKIP')
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# m4_include(lib/common.sh)
|
||||
|
||||
source @libdir@/shared_lib.sh
|
||||
source @libdir@/functions.sh
|
||||
|
||||
get_profiles(){
|
||||
local prof= temp=
|
||||
|
|
132
lib/common.sh
132
lib/common.sh
|
@ -1,132 +0,0 @@
|
|||
# Avoid any encoding problems
|
||||
export LANG=C
|
||||
|
||||
# check if messages are to be printed using color
|
||||
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||
if [[ -t 2 ]]; then
|
||||
# prefer terminal safe colored and bold text when tput is supported
|
||||
if tput setaf 0 &>/dev/null; then
|
||||
ALL_OFF="$(tput sgr0)"
|
||||
BOLD="$(tput bold)"
|
||||
BLUE="${BOLD}$(tput setaf 4)"
|
||||
GREEN="${BOLD}$(tput setaf 2)"
|
||||
RED="${BOLD}$(tput setaf 1)"
|
||||
YELLOW="${BOLD}$(tput setaf 3)"
|
||||
else
|
||||
ALL_OFF="\e[1;0m"
|
||||
BOLD="\e[1;1m"
|
||||
BLUE="${BOLD}\e[1;34m"
|
||||
GREEN="${BOLD}\e[1;32m"
|
||||
RED="${BOLD}\e[1;31m"
|
||||
YELLOW="${BOLD}\e[1;33m"
|
||||
fi
|
||||
fi
|
||||
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||
|
||||
plain() {
|
||||
local mesg=$1; shift
|
||||
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
msg() {
|
||||
local mesg=$1; shift
|
||||
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
msg2() {
|
||||
local mesg=$1; shift
|
||||
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
warning() {
|
||||
local mesg=$1; shift
|
||||
printf "${YELLOW}==> WARNING:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
error() {
|
||||
local mesg=$1; shift
|
||||
printf "${RED}==> ERROR:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
}
|
||||
|
||||
stat_busy() {
|
||||
local mesg=$1; shift
|
||||
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" >&2
|
||||
}
|
||||
|
||||
stat_done() {
|
||||
printf "${BOLD}done${ALL_OFF}\n" >&2
|
||||
}
|
||||
|
||||
setup_workdir() {
|
||||
[[ -z $WORKDIR ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
[[ -n $WORKDIR ]] && rm -rf "$WORKDIR"
|
||||
[[ $1 ]] && exit $1
|
||||
}
|
||||
|
||||
abort() {
|
||||
msg 'Aborting...'
|
||||
cleanup 0
|
||||
}
|
||||
|
||||
trap_abort() {
|
||||
trap - EXIT INT QUIT TERM HUP
|
||||
abort
|
||||
}
|
||||
|
||||
trap_exit() {
|
||||
trap - EXIT INT QUIT TERM HUP
|
||||
cleanup
|
||||
}
|
||||
|
||||
die() {
|
||||
error "$*"
|
||||
cleanup 1
|
||||
}
|
||||
|
||||
trap 'trap_abort' INT QUIT TERM HUP
|
||||
trap 'trap_exit' EXIT
|
||||
|
||||
##
|
||||
# usage : in_array( $needle, $haystack )
|
||||
# return : 0 - found
|
||||
# 1 - not found
|
||||
##
|
||||
in_array() {
|
||||
local needle=$1; shift
|
||||
local item
|
||||
for item in "$@"; do
|
||||
[[ $item = $needle ]] && return 0 # Found
|
||||
done
|
||||
return 1 # Not Found
|
||||
}
|
||||
|
||||
##
|
||||
# usage : get_full_version( [$pkgname] )
|
||||
# return : full version spec, including epoch (if necessary), pkgver, pkgrel
|
||||
##
|
||||
get_full_version() {
|
||||
# set defaults if they weren't specified in buildfile
|
||||
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||
epoch=${epoch:-0}
|
||||
if [[ -z $1 ]]; then
|
||||
if [[ $epoch ]] && (( ! $epoch )); then
|
||||
echo $pkgver-$pkgrel
|
||||
else
|
||||
echo $epoch:$pkgver-$pkgrel
|
||||
fi
|
||||
else
|
||||
for i in pkgver pkgrel epoch; do
|
||||
local indirect="${i}_override"
|
||||
eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
|
||||
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
|
||||
done
|
||||
if (( ! $epoch_override )); then
|
||||
echo $pkgver_override-$pkgrel_override
|
||||
else
|
||||
echo $epoch_override:$pkgver_override-$pkgrel_override
|
||||
fi
|
||||
fi
|
||||
}
|
Loading…
Reference in a new issue