Package: at
Version: 3.1.13-1
Severity: normal
User: [email protected]
Usertags: cross
Tags: patch

Few changes are needed to crosscompile at package.

1. configure -> dh_auto_configure

not mandatory change, but dh_auto_configure will do the --build and --host 
setting for automatically, making the build command shorter

2. make test -> dh_auto_test

dh_auto_test will respect DEB_BUILD_OPTIONS=nocheck, so when crosscompiling 
tests
don't need to be run

3. configure.ac change

dont try to use AC_TRY_RUN when crosscompiling. This patch requires running 
autoconf
to change the configure file too. please submit this patch to upstream too.

4. makefile.in change

don't use "install -s" in "make install", that means 
"DEB_BUILD_OPTIONS=nostrip" option
will not work. This is also a patch to propose upstream.

Cheers,
Riku



diff -u at-3.1.12/debian/rules at-3.1.12/debian/rules
--- at-3.1.12/debian/rules
+++ at-3.1.12/debian/rules
@@ -5,15 +5,6 @@
             --with-atspool=/var/spool/cron/atspool \
             SENDMAIL=/usr/sbin/sendmail
 
-export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  confflags += --build $(DEB_HOST_GNU_TYPE)
-else
-  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
-endif
-
 build: build-stamp
 build-stamp:
 	[ -f config.sub.ori ] || mv config.sub config.sub.ori
@@ -21,9 +12,10 @@
 	ln -sf /usr/share/misc/config.sub .
 	ln -sf /usr/share/misc/config.guess .
 
-	./configure $(confflags)
-	$(MAKE)
-	$(MAKE) test
+	dh_auto_configure -- $(confflags)
+	dh_auto_build
+	dh_auto_test
+
 	touch $@
 
 clean:
--- at-3.1.12.orig/configure.ac
+++ at-3.1.12/configure.ac
@@ -38,12 +38,17 @@
     AC_MSG_RESULT(no)
     ;;
 esac
+
+
+if test "$cross_compiling" = no
+then
 AC_MSG_CHECKING(Trying to compile a trivial ANSI C program)
 AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
     AC_MSG_RESULT(yes),
     AC_MSG_RESULT(no)
     AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.),
     AC_MSG_ERROR(Could not compile and run even a trivial ANSI C program - check CC.))
+fi
 
 AC_MSG_CHECKING(__attribute__((noreturn)))
 AC_TRY_COMPILE([], [void __attribute__((noreturn)) panic(void);],
only in patch2:
unchanged:
--- at-3.1.12.orig/Makefile.in
+++ at-3.1.12/Makefile.in
@@ -97,14 +97,14 @@
 	chmod 600 $(IROOT)$(LFILE)
 	chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(IROOT)$(LFILE)
 	test -f $(IROOT)$(etcdir)/at.allow || test -f $(IROOT)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(IROOT)$(etcdir)/
-	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 -s at $(IROOT)$(bindir)
+	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 at $(IROOT)$(bindir)
 	$(LN_S) -f at $(IROOT)$(bindir)/atq
 	$(LN_S) -f at $(IROOT)$(bindir)/atrm
 	$(INSTALL) -g root -o root -m 755 batch $(IROOT)$(bindir)
 	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man1dir)
 	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man5dir)
 	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man8dir)
-	$(INSTALL) -g root -o root -m 755 -s atd $(IROOT)$(sbindir)
+	$(INSTALL) -g root -o root -m 755 atd $(IROOT)$(sbindir)
 	$(INSTALL) -g root -o root -m 755 atrun $(IROOT)$(sbindir)
 	$(INSTALL) -g root -o root -m 644 at.1 $(IROOT)$(man1dir)/
 	cd $(IROOT)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1

Reply via email to