aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 10:25:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-30 10:25:00 +0000
commitb99a274520870ce44d4aebd7da1c5bbde0bd5f5c (patch)
tree948555975eb304c8d3e9727c2515ec547b21064e
parentc62dc32168726e8264ecec9c728471b192f1b46a (diff)
downloadpaludis-b99a274520870ce44d4aebd7da1c5bbde0bd5f5c.tar.gz
paludis-b99a274520870ce44d4aebd7da1c5bbde0bd5f5c.tar.xz
More ebuild work. Add LIBEXECDIR define.
-rw-r--r--ebuild/install_functions.bash93
-rw-r--r--ebuild/unpack_functions.bash79
-rw-r--r--paludis/Makefile.am.m42
-rw-r--r--src/Makefile.am2
-rw-r--r--src/paludis.cc1
5 files changed, 131 insertions, 46 deletions
diff --git a/ebuild/install_functions.bash b/ebuild/install_functions.bash
index a6c77b1..2610614 100644
--- a/ebuild/install_functions.bash
+++ b/ebuild/install_functions.bash
@@ -36,59 +36,64 @@ keepdir()
fi
}
-unpack()
+into()
{
- [[ -z "$@" ]] && die "No arguments given to unpack"
-
- for x in "$@" ; do
- echo ">>> Unpacking ${x} to ${PWD}"
- [[ "${x:0:2}" == "./" ]] || x="${DISTDIR}/${x}"
- unpack_one "${x}"
- done
+ if [[ "${1}" == "/" ]] ; then
+ export DESTTREE=
+ else
+ export DESTTREE="${1}"
+ [[ -d "${D}${DESTTREE}" ]] || install -d "${D}${DESTTREE}"
+ fi
}
-unpack_one()
+insinto()
{
- [[ -z "$1" ]] && die "Bad argument for unpack_one"
- [[ -e "$1" ]] || die "${1} doesn't exist"
-
- case "${x}" in
- *.tar)
- tar xf "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.tar.gz|*.tgz)
- tar zxf "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.tar.bz2|*.tbz2
- tar jxf "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.zip|*.ZIP|*.jar)
- unzip -qo "${1}" || die "Couldn't unpack ${1}"
- ;;
+ if [[ "${1}" == "/" ]] ; then
+ export INSDESTTREE=
+ else
+ export INSDESTTREE="${1}"
+ [[ -d "${D}${INSDESTTREE}" ]] || install -d "${D}${INSDESTTREE}"
+ fi
+}
- *.gz|*.Z|*.z)
- gzip -dc "${1}" > "${1%.*}" || die "Couldn't unpack ${1}"
- ;;
+exeinto()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export EXEDESTTREE=
+ else
+ export EXEDESTTREE="${1}"
+ [[ -d "${D}${EXEDESTTREE}" ]] || install -d "${D}${EXEDESTTREE}"
+ fi
+}
- *.bz2)
- bunzip2 -dc "${1}" > "${1%.*}" || die "Couldn't unpack ${1}"
- ;;
+docinto()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export DOCDESTTREE=
+ else
+ export DOCDESTTREE="${1}"
+ [[ -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]] || \
+ install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}"
+ fi
+}
- *.rar|*.RAR)
- unrar x -idq "${1}" || die "Couldn't unpack ${1}"
- ;;
+insopts()
+{
+ export INSOPTIONS="$@"
+}
- *.LHa|*.LHA|*.lha|*.lzh)
- lha xqf "${1}" || die "Couldn't unpack ${1}"
- ;;
+diropts()
+{
+ export DIROPTIONS="$@"
+}
- *)
- echo "Skipping unpack for ${1}"
- ;;
- esac
+exeopts()
+{
+ export EXEOPTIONS="$@"
+}
+libopts()
+{
+ export LIBOPTIONS="$@"
}
diff --git a/ebuild/unpack_functions.bash b/ebuild/unpack_functions.bash
new file mode 100644
index 0000000..f9b98f0
--- /dev/null
+++ b/ebuild/unpack_functions.bash
@@ -0,0 +1,79 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.org>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+unpack()
+{
+ [[ -z "$@" ]] && die "No arguments given to unpack"
+
+ for x in "$@" ; do
+ echo ">>> Unpacking ${x} to ${PWD}"
+ [[ "${x:0:2}" == "./" ]] || x="${DISTDIR}/${x}"
+ unpack_one "${x}"
+ done
+}
+
+unpack_one()
+{
+ [[ -z "$1" ]] && die "Bad argument for unpack_one"
+ [[ -e "$1" ]] || die "${1} doesn't exist"
+
+ case "${x}" in
+ *.tar)
+ tar xf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.gz|*.tgz)
+ tar zxf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.bz2|*.tbz2
+ tar jxf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.zip|*.ZIP|*.jar)
+ unzip -qo "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.gz|*.Z|*.z)
+ gzip -dc "${1}" > "${1%.*}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.bz2)
+ bunzip2 -dc "${1}" > "${1%.*}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.rar|*.RAR)
+ unrar x -idq "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.LHa|*.LHA|*.lha|*.lzh)
+ lha xqf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *)
+ echo "Skipping unpack for ${1}"
+ ;;
+ esac
+
+}
+
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 9114b5f..96a0bf0 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -30,7 +30,7 @@ include(`paludis/files.m4')
CLEANFILES = *~
MAINTAINERCLEANFILES = Makefile.in Makefile.am about.hh paludis.hh smart_record.hh comparison_policy.hh
AM_CXXFLAGS = -I$(top_srcdir)
-DEFS=-DSYSCONFDIR=\"$(sysconfdir)\"
+DEFS=-DSYSCONFDIR=\"$(sysconfdir)\" -DLIBEXECDIR=\"$(libexecdir)\"
EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 smart_record.hh.m4 comparison_policy.hh.m4 \
testscriptlist
SUBDIRS = . args
diff --git a/src/Makefile.am b/src/Makefile.am
index 85c5460..83c182e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
CLEANFILES = *~ version_TEST
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = -I$(top_srcdir)
-DEFS=-DSYSCONFDIR=\"$(sysconfdir)\"
+DEFS=-DSYSCONFDIR=\"$(sysconfdir)\" -DLIBEXECDIR=\"$(libexecdir)\"
bin_PROGRAMS = paludis
diff --git a/src/paludis.cc b/src/paludis.cc
index d863470..8dab2dc 100644
--- a/src/paludis.cc
+++ b/src/paludis.cc
@@ -127,6 +127,7 @@ main(int argc, char *argv[])
cout << "CXXFLAGS: " << PALUDIS_BUILD_CXXFLAGS << endl;
cout << "LDFLAGS: " << PALUDIS_BUILD_LDFLAGS << endl;
cout << "SYSCONFDIR: " << SYSCONFDIR << endl;
+ cout << "LIBEXECDIR: " << LIBEXECDIR << endl;
cout << "stdlib: "
#if defined(__GLIBCXX__)
<< "GNU libstdc++"