2
\$\begingroup\$

I've developed a C application for Ubuntu and created the installer. The file structure is

├── autom4te.cache
├── build-aux
├── contrib
├── debian
│  └── source
├── doc
├── gnulib
│  ├── lib
│  └── m4
├── man
├── po
├── src
└── tests

configure.ac

dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_INIT([GNU Hello], [2.7], [[email protected]])
dnl Must come before AM_INIT_AUTOMAKE.
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([readme-alpha dist-xz])
# Minimum Autoconf version required.
AC_PREREQ(2.60)
# Where to generate output; srcdir location.
AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
AC_CONFIG_SRCDIR([src/main.c])
dnl Checks for programs.
# We need a C compiler.
AC_PROG_CC
# Since we use gnulib: gl_EARLY must be called as soon as possible after
# the C compiler is checked. The others could be later, but we just
# keep everything together.
gl_EARLY
gl_INIT
# GNU help2man creates man pages from --help output; in many cases, this
# is sufficient, and obviates the need to maintain man pages separately.
# However, this means invoking executables, which we generally cannot do
# when cross-compiling, so we test to avoid that (the variable
# "cross_compiling" is set by AC_PROG_CC).
if test $cross_compiling = no; then
 AM_MISSING_PROG(HELP2MAN, help2man)
else
 HELP2MAN=:
fi
# i18n support from GNU gettext.
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])
AC_CONFIG_FILES([Makefile
 contrib/Makefile
 doc/Makefile
 gnulib/lib/Makefile
 man/Makefile
 po/Makefile.in
 src/Makefile
 tests/Makefile])
AC_OUTPUT

Top-level Makefile.am

# Process this file with automake to produce Makefile.in (in this,
# and all subdirectories).
# Makefile for the top-level directory of GNU hello.
# 
# Copyright 1997, 1998, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
#
# 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 3, 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, see <http://www.gnu.org/licenses/>.
# Find gnulib headers.
ACLOCAL_AMFLAGS = -I gnulib/m4
# Additional files to distribute.
EXTRA_DIST = ChangeLog.O gnulib/m4/gnulib-cache.m4
# Subdirectories to descend into.
SUBDIRS = contrib gnulib/lib po src doc man
# `make diff' produces a diff against the previous version, given both
# .tar.gz's in the current directory. This should only be done when an
# official release is made (and only if you care to provide diffs).
#
hello_pre = 2.6
diff: diffcheck
 @(echo "To apply these patches, cd to the main directory of the package"; \
 echo "and then use \`patch -p1 <hello-XXX.diff'."; \
 echo "Before building the program, run \`autogen.sh'."; ) > \
 $(PACKAGE)-$(hello_pre)-$(VERSION).diff
 -diff -rc2P --exclude=configure --exclude=config.h.in --exclude=*.info \
 --exclude=*.gmo --exclude=aclocal.m4 \
 $(PACKAGE)-$(hello_pre) $(PACKAGE)-$(VERSION) >> \
 $(PACKAGE)-$(hello_pre)-$(VERSION).diff
 gzip --force --best $(PACKAGE)-$(hello_pre)-$(VERSION).diff
diffcheck:
 for d in $(PACKAGE)-$(hello_pre) $(PACKAGE)-$(VERSION) ; do \
 if test ! -d $$d ; then \
	 if test -r $$d.tar.gz ; then \
 tar -zxf $$d.tar.gz ; \
 else \
	 echo subdir $$d does not exist. ; \
 exit 1 ; \
 fi ; \
 fi ; \
 done
# Verify that all source files using _() are listed in po/POTFILES.in.
# The idea is to run this before making pretests, as well as official
# releases, so that translators will be sure to have all the messages.
# (From coreutils.)
po-check:
 if test -f po/POTFILES.in; then \
 grep -E -v '^(#|$$)' po/POTFILES.in				\
	 | grep -v '^src/false\.c$$' | sort > $@-1; \
 files=; \
 for file in $$($(CVS_LIST_EXCEPT)) `find * -name '*.[ch]'`; do \
	 case $$file in \
 djgpp/* | man/*) continue;; \
 esac; \
 case $$file in						\
	 *.[ch])							\
	 base=`expr " $$file" : ' \(.*\)\..'`; \
 { test -f $$base.l || test -f $$base.y; } && continue;; \
 esac; \
 files="$$files $$file"; \
 done; \
 grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
 | sort -u > $@-2; \
 diff -u $@-1 $@-2 || exit 1; \
 rm -f $@-1 $@-2; \
 fi
# Example of updating the online web pages for the documentation
# with the gendocs.sh script; see
# http://www.gnu.org/prep/maintain/html_node/Invoking-gendocs_002esh.html
#
gnulib = $(HOME)/gnu/src/gnulib
gendocs = $(gnulib)/build-aux/gendocs.sh
gendocs_templates = $(gnulib)/doc
gendocs_envvars = GENDOCS_TEMPLATE_DIR=$(gendocs_templates)
#
manual = hello
manual_title = "Hello, GNU World"
email = [email protected]
gendocs_args = --email $(email) $(manual) $(manual_title)
#
www_target = $(HOME)/gnu/www/hello/manual
#
doctemp = doc/wwwtemp
wwwdoc:
 rm -rf $(doctemp) && mkdir $(doctemp)
 cd $(doctemp) \
 && ln -s ../*.texi . \
 && env $(gendocs_envvars) $(gendocs) $(gendocs_args)
 cp -arf $(doctemp)/manual/. $(www_target)
 ls -ltu $(www_target)/html_node | tail # cvs rm -f obsolete files
# followed by cvs add of new files and cvs commit.

src level Makefile.am

# Makefile.am for hello/src.
#
# Copyright 1996, 1997, 2001, 2005, 2006, 2007, 2008 Free Software
# Foundation, Inc.
#
# 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 3, 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, see <http://www.gnu.org/licenses/>.
bin_PROGRAMS = opsh
opsh_SOURCES = edit.c eval.c exec.c expr.c funcs.c histrap.c jobs.c lalloc.c lex.c main.c misc.c shf.c syn.c tree.c var.c
opsh_LDADD = @LIBINTL@ ../gnulib/lib/libgnu.a -lbsd -L/lib
localedir = $(datadir)/locale
AM_CPPFLAGS = -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
asked Aug 10, 2017 at 1:43
\$\endgroup\$
2
  • 1
    \$\begingroup\$ Is your program actually copyright FSF (and called hello/src)? If not, then those comments need an update! \$\endgroup\$ Commented Aug 10, 2017 at 14:47
  • \$\begingroup\$ @TobySpeight The program in the question was my first non-trivial autotools project so I changed only what I needed and will update those comments now. \$\endgroup\$ Commented Aug 10, 2017 at 14:49

1 Answer 1

2
\$\begingroup\$

Looks good. Ship it.

Your first two files appear to be all or mostly boilerplate, with maybe the set of subdirs being project specific.

It seems likely the link editor would already look in /lib, so -L/lib may be redundant. And -lbsd seems like a blast from the past.

I imagine that dh_make / debuild work cleanly with your package.

answered Aug 10, 2017 at 2:05
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.