Changeset 41
- Timestamp:
- 05/30/05 01:25:58 (4 years ago)
- Files:
-
- bpkg/trunk/bpkg (modified) (11 diffs)
- bpkg/trunk/Makefile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bpkg/trunk/bpkg
r40 r41 48 48 # XXXXXXXXXXXXXX Not really user-modifiable below here XXXXXXXXXXXXX 49 49 # 50 VERSION="0. 1"50 VERSION="0.2" 51 51 PACKAGER=auto 52 52 SELF=`basename $0` … … 106 106 107 107 warning() { 108 print bold brown "warning -- $*" 108 print bold brown "warning -- $*" 1>&2 109 109 } 110 110 111 111 error() { 112 print bold red "error -- $*" 112 print bold red "error -- $*" 1>&2 113 113 exit 1 114 114 } … … 124 124 export INSTALLWATCH_BACKUP_PATH=$SRCDIR/backup-`date +%Y%m%d%H%M%S-backup` 125 125 fi 126 installwatch -o $INSTALLLOG "$@" || e xit $?126 installwatch -o $INSTALLLOG "$@" || error "package installation failed" 127 127 if [ $BACKUP = 1 -a -d $INSTALLWATCH_BACKUP_PATH ]; then 128 128 notice "Archiving backup to $INSTALLWATCH_BACKUP_PATH.tar.gz" … … 166 166 notice "detected configuration files: $configs" 167 167 notice "detected dependencies: $deps" 168 cat <<-EOF > $TMPDIR/PKGBUILD 168 cd $TMPDIR 169 cat <<-EOF > PKGBUILD 169 170 pkgname=$PACKAGE 170 171 pkgver=$PACKAGEVER … … 181 182 } 182 183 EOF 183 cd $TMPDIR184 184 makepkg || error "makepkg failed" 185 185 cp $TMPDIR/*.pkg.tar.gz $PKGDIR … … 187 187 } 188 188 189 packager_pre_gentoo() 190 { 191 eval `grep ^PORTDIR_OVERLAY /etc/make.conf` 192 if [ -z "$PORTDIR_OVERLAY" ]; then 193 error "You have not configured a portage overlay directory. Refer to http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds for more information." 194 fi 195 } 196 189 197 packager_gentoo() 190 198 { 191 error "Gentoo packager not complete" 199 installer make install 200 #local deps=`(cd $DESTROOT && find . -type f | xargs --no-run-if-empty file | grep 'ELF.*executable' | cut -d: -f1 | xargs --no-run-if-empty ldd 2> /dev/null | awk '{print $3}' | grep ^/ | xargs --no-run-if-empty pacman -Qo 2> /dev/null | awk '{print $5}' | sort | uniq) 2> /dev/null` 201 ls -d /usr/portage/*/$PACKAGE > /dev/null 2>&1 && error "Package '$PACKAGE' already exists in portage." 202 eval `grep ^PORTDIR_OVERLAY /etc/make.conf` 203 if [ ! -d "$PORTDIR_OVERLAY" ]; then 204 notice "Creating portage overlay directory: $PORTDIR_OVERLAY" 205 fi 206 mkdir -p $PORTDIR_OVERLAY/app-misc/$PACKAGE 207 cd $PORTDIR_OVERLAY/app-misc/$PACKAGE 208 local ebuild=$PACKAGE-$PACKAGEVER.ebuild 209 info "Generating ebuild: $ebuild" 210 cat <<-EOF > $ebuild 211 inherit eutils flag-o-matic 212 DESCRIPTION="$PACKAGE (automatically packaged by $SELF)" 213 HOMEPAGE="Unknown, refer to http://swapoff.org/bpkg for information on packager" 214 SRC_URI="" 215 LICENSE="UNKNOWN" 216 SLOT="0" 217 DEPENDS="" 218 KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 ppc-macos s390 sh sparc x86 x86-obsd x86-fbsd" 219 220 src_unpack() { 221 : 222 } 223 224 src_compile() { 225 : 226 } 227 228 src_install() { 229 test -d $DESTROOT || die "You need to install $PACKAGE with $SELF. Can not be emerged." 230 cp -a $DESTROOT/* \${D}/ || die "packaging failed" 231 } 232 EOF 233 info "Integrating package into world" 234 ebuild $ebuild digest 235 emerge $PACKAGE 192 236 } 193 237 … … 200 244 } 201 245 202 packager_auto()246 detect_os() 203 247 { 204 248 if [ -r /etc/slackware-version ]; then 205 packager_slackware "$@"249 echo slackware 206 250 elif [ -r /etc/redhat-release ]; then 207 packager_redhat "$@"251 echo redhat 208 252 elif [ -r /etc/SuSE-release ]; then 209 packager_suse "$@"253 echo suse 210 254 elif [ -r /etc/arch-release ]; then 211 packager_arch "$@"255 echo arch 212 256 elif [ -r /etc/gentoo-release ]; then 213 packager_gentoo "$@"257 echo gentoo 214 258 else 215 259 error "could not determine packaging system to use" … … 263 307 264 308 Available <bpkg-options> are: 309 --help 310 This help. 265 311 --version 266 312 Show $SELF version. 267 313 --skip-configure 268 Do not perform the configure phase of bpkg. Useful for already extracted314 Do not perform the configure phase of bpkg. Useful for already configured 269 315 source. 270 316 --packager=arch|slackware|rpm|deb|gentoo|redhat|suse|auto … … 272 318 default. 273 319 --package=<name>-<version> 274 Override package name and version auto-detection. Sometimes necessary if 275 the extracted directory name is not useful. 320 Override package name and version auto-detection. By default this is 321 obtained by extracting the package name and version from the package 322 source directory name. 276 323 --unique 277 324 Pass options to autoconf to install into configuration and data directories … … 320 367 shift 321 368 done 369 370 test $PACKAGER = auto && PACKAGER=`detect_os` 371 372 declare -F | grep " packager_pre_$PACKAGER\$" > /dev/null && eval packager_pre_$PACKAGER 373 declare -F | grep " packager_$PACKAGER\$" > /dev/null || error "no such function packager_$PACKAGER()" 322 374 323 375 if [ "$PACKAGE" = "$PACKAGEVER" ]; then … … 375 427 make || error "'make failed'" 376 428 377 declare -F | grep " packager_$PACKAGER\$" > /dev/null || error "no such packager $PACKAGER"378 379 429 eval packager_$PACKAGER 380 430 bpkg/trunk/Makefile
r40 r41 2 2 PREFIX=/usr 3 3 INSTALLWATCH=installwatch-0.6.3 4 DIST=bpkg Makefile COPYING $(INSTALLWATCH).tgz4 DIST=bpkg Makefile README COPYING $(INSTALLWATCH).tgz 5 5 6 6 all: $(INSTALLWATCH) … … 8 8 9 9 install: $(INSTALLWATCH) 10 mkdir -p $(DESTDIR)$(PREFIX)/bin 11 mkdir -p $(DESTDIR)$(PREFIX)/lib 10 12 install -m755 bpkg $(DESTDIR)$(PREFIX)/bin 11 $(MAKE) -C $(INSTALLWATCH) PREFIX=$(PREFIX) install13 $(MAKE) -C $(INSTALLWATCH) PREFIX=$(PREFIX) BINDIR=$(DESTDIR)$(PREFIX)/bin LIBDIR=$(DESTDIR)$(PREFIX)/lib install 12 14 @cat README 13 15
