Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Mar 11, 2005
1 parent 0fe3c32 commit a972dc5
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -35,6 +35,10 @@ Version 0.6.1 # Probably the last version using bash
- dar-update: Improved the handling of updates to update tools
- dar-build: Experimental usage of /dev/shm for building
- dar-functions: Moved to /usr/share instead of /usr/lib
- scripts: Added pre-svn-rev script to add Revision to changelog
- scripts: Added pre-brand script to add branding/packager/vendor to SPEC
- dar-exec: Export $dist, $nick, $path, $arch, $repo and $tag
- dar-shell: Export $dist, $nick, $path, $arch, $repo and $tag

Version 0.6.0
- dar.conf: Removed DISTSMAP, added it to dists specific section
Expand Down
13 changes: 12 additions & 1 deletion dar-build
Expand Up @@ -169,7 +169,8 @@ for app in $PKGS; do

cp -af "$SPECFILE" "$NEWSPECFILE"

export buildarch="$arch" distarch="$DISTARCH" disttag="${DISTTAG// *}" specfile="$NEWSPECFILE" repotag="$TAG"
export origspecfile="$SPECFILE" specfile="$NEWSPECFILE"
export buildarch="$arch" distarch="$DISTARCH" disttag="${DISTTAG// *}" repotag="$TAG"
for script in $CONFIGDIR/scripts/pre-*.sh; do
source "$script"
done
Expand Down Expand Up @@ -402,6 +403,13 @@ for app in $PKGS; do
if [ -z "$SOURCE_DISTS" ]; then SOURCE_DISTS="$DEFAULT_SOURCE_DISTS"; fi

for dist in $SOURCE_DISTS; do
if [ -r "$CONFIGDIR/dists/$dist/config" ]; then
source "$CONFIGDIR/dists/$dist/config"
else
warning "Configfile $CONFIGDIR/dists/$dist/config missing. Aborting."
continue
fi

RPMFILE="$app-$VERSION-$RELEASE.$TAG.src.rpm"

NEWSPECFILE="$TEMPDIR/$app.spec"
Expand All @@ -417,6 +425,9 @@ for app in $PKGS; do
--define "_srcrpmdir $PACKAGEDIR/$app" \
--define "_sourcedir $SPECDIR" \
--define "$dist 1" \
--define "dist $DISTNAME" \
--define "disttag ${DISTTAG// *}" \
--define "$DISTNAME 1" \
"$NEWSPECFILE"

cp -au "$NEWSPECFILE" "$PACKAGEDIR/$app/"
Expand Down
2 changes: 1 addition & 1 deletion dar-exec
Expand Up @@ -21,7 +21,7 @@ for distname in $DISTS; do

if [ -r "$CONFIGDIR/dists/$distname/config" ]; then
source "$CONFIGDIR/dists/$distname/config"
export distname DISTNAME DISTNICK DISTTAG DISTPATH DISTARCH
export arch="$DISTARCH" dist="${DISTNAME// *}" nick="$DISTNICK" path="$DISTPATH" repo="$REPO" tag="$TAG"
fi

### Check for building as user
Expand Down
1 change: 1 addition & 0 deletions dar-shell
Expand Up @@ -20,6 +20,7 @@ echo "Entering shells."
for distname in $DISTS; do
if [ -r "$CONFIGDIR/dists/$distname/config" ]; then
source "$CONFIGDIR/dists/$distname/config"
export arch="$DISTARCH" dist="${DISTNAME// *}" nick="$DISTNICK" path="$DISTPATH" repo="$REPO" tag="$TAG"
fi

chroot $CHROOTDIR/$distname
Expand Down
7 changes: 5 additions & 2 deletions scripts/pre-brand.sh
@@ -1,5 +1,8 @@
#!/bin/bash

### This script adds proper Packager and Vendor tags to the SPEC file
### so that the Source packages contains a branded SPEC file.

#echo "** pre-brand: Specfile: $specfile"
#set -x

Expand All @@ -20,10 +23,10 @@ esac
vendor="Dag Apt Repository, http://dag.wieers.com/apt/"

### Removing existing branding
perl -pi.orig -e 's/^(Packager|Vendor|Distribution):.+\n$//m' "$specfile"
perl -pi.orig -e 's/^(Packager|Vendor|Distribution):.+\n$//is' "$specfile"

### Add own branding
perl -pi.orig -e 's|^(Source:.+)$|Packager: '"$packager"'\nVendor: '"$vendor"'\n\n$1|' "$specfile"
perl -pi.orig -e 's|^(Source0?:.+)$|Packager: '"$packager"'\nVendor: '"$vendor"'\n\n$1|i' "$specfile"

#set +x
#diff -u "$specfile.orig" "$specfile"
3 changes: 3 additions & 0 deletions scripts/pre-disttag.sh
@@ -1,5 +1,8 @@
#!/bin/bash

### This script add a disttag to the SPEC file so packages can be
### identified easier, are unique and don't have the macro clutter.

#echo "** pre-disttag: BuildArch: $buildarch, Disttag: $disttag, Repotag: $repotag, Specfile: $specfile"
#set -x

Expand Down
3 changes: 3 additions & 0 deletions scripts/pre-stub.sh
@@ -1,3 +1,6 @@
#!/bin/bash

### This is a stub script, it currently does nothing but
### could be used to debug.

#set -x
31 changes: 31 additions & 0 deletions scripts/pre-svn-rev.sh
@@ -0,0 +1,31 @@
#!/bin/bash

### This scripts add the last change author and revision to the
### changelog of the SPEC file, so RPM packages include it.

#echo "** pre-svn-rev: OrigSpecfile: $origspecfile, Specfile: $specfile"
#set -x

### Get Author and Revision from original specfile
info=""; author=""; revision=""
set -- $(
while [ -z "$info" ]; do
info="$(svn info $origspecfile 2>/dev/null)"
if [ "$info" ]; then
echo "$info" | grep -E '^Last Changed Author: ' | sed -e 's|Last Changed Author: ||'
echo "$info" | grep -E '^Last Changed Rev: ' | sed -e 's|Last Changed Rev: ||'
break
else
sleep 5
fi
done
)
author="$1"; revision="$2"

#echo "** pre-svn-rev: Author: $author, Revision: $revision"

### Add Revision and Author to specfile
perl -pi.orig -0 -e 's|\n%changelog\n(\*\s.+)\n|\n%changelog\n$1 - '$revision'/'$author'\n|' $specfile

#diff -u "$specfile".orig "$specfile"
#set +x

0 comments on commit a972dc5

Please sign in to comment.