#!/bin/bash # # Copyright (C) 2008 Brian Brazil # # This program 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. # # This program 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # set -ex . config rm -rf $WORKINGDIR mkdir -p $WORKINGDIR cd $WORKINGDIR apt-get source xorg-server$VERSION apt-get --yes build-dep xorg-server$VERSION mkdir tmp tar -C tmp -xzf xorg-server_*.orig.tar.gz # Remove non-free bits for .orig, and patched version fgrep -r -l http://oss.sgi.com/projects/FreeB . | xargs rm fgrep -r -l http://www.sgi.com/software/opensource/glx/license.html . | xargs rm # Regenerate diff diff -ruN tmp/xorg-server*/ xorg-server*/ | gzip -c > xorg-server_*.diff.gz # Repackage orig.tar.gz tar -C tmp -czf xorg-server_*.orig.tar.gz xorg-server*/ rename 's/(xorg-server)/$1-free/' xorg-server_*.orig.tar.gz cd xorg-server*/ # Make it build without the non-free bits sed -i -e 's/--enable-dri/--disable-dri --disable-glx/' \ -e 's/--enable-dmx/--disable-dmx/' debian/rules echo > debian/xdmx.install echo > debian/xdmx-tools.install dch -D $RELEASE -v $(sed -n '1s#^.*(\(.*\)).*#\1'${DISTRONAME_L}${XORG_SERVER_VERSION}'#p' debian/changelog) "Removed non-free code" dpkg-buildpackage -rfakeroot -us -uc