2004-02-09 23:22:54 +00:00
|
|
|
# $FreeBSD$
|
2004-08-07 03:09:28 +00:00
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# This Makefile is for use with the FreeBSD buid system. For
|
|
|
|
# non-FreeBSD systems, you should first "make distfile" on FreeBSD,
|
|
|
|
# then use the resulting tar.gz archive--which contains a portable
|
|
|
|
# autoconf/automake-generated build system--on the other system.
|
2004-08-07 03:09:28 +00:00
|
|
|
|
|
|
|
LIB= archive
|
2005-11-10 18:07:07 +00:00
|
|
|
DPADD= ${LIBBZ2} ${LIBZ}
|
|
|
|
LDADD= -lbz2 -lz
|
2005-10-13 05:51:38 +00:00
|
|
|
|
|
|
|
# Versioning <sigh>. There are three distinct sets of version
|
|
|
|
# numbers:
|
|
|
|
# * libarchive version
|
|
|
|
# * libtool version (for shared libs built using configure script)
|
|
|
|
# * FreeBSD SHLIB_MAJOR
|
|
|
|
# The following logic helps ensure that there is some consistency across
|
|
|
|
# these three:
|
|
|
|
|
|
|
|
# First, the libarchive version is in three parts:
|
|
|
|
# Bumped ONLY when API/ABI breakage happens (non-backwards-compatible change).
|
|
|
|
ARCHIVE_API_MAJOR= 1
|
|
|
|
# Bumped when significant new features are added.
|
|
|
|
# Also used to bump SHLIB_MAJOR for reasons other than API/ABI breakage.
|
|
|
|
# Note: Do NOT reset this to zero after bumping ARCHIVE_API_MAJOR!
|
|
|
|
ARCHIVE_API_MINOR= 2
|
|
|
|
# Bumped often. ;-)
|
2006-01-17 03:40:42 +00:00
|
|
|
ARCHIVE_API_REVISION= 37
|
2005-10-13 05:51:38 +00:00
|
|
|
# Full libarchive version combines the above three numbers.
|
2005-10-14 16:32:50 +00:00
|
|
|
VERSION= ${ARCHIVE_API_MAJOR}.${ARCHIVE_API_MINOR}.${ARCHIVE_API_REVISION}
|
2005-10-13 05:51:38 +00:00
|
|
|
|
|
|
|
# The FreeBSD SHLIB_MAJOR is computed from the above values.
|
2005-10-14 16:32:50 +00:00
|
|
|
SHLIB_MAJOR!= echo $$((${ARCHIVE_API_MAJOR} + ${ARCHIVE_API_MINOR}))
|
2005-10-13 05:51:38 +00:00
|
|
|
|
|
|
|
# The SHLIB_MAJOR computation above helps ensure that the libtool
|
|
|
|
# version (computed in configure.ac.in) provides the same
|
|
|
|
# shared library number as is used on FreeBSD.
|
|
|
|
|
2004-08-07 03:09:28 +00:00
|
|
|
CFLAGS+= -DPACKAGE_NAME=\"lib${LIB}\"
|
|
|
|
CFLAGS+= -DPACKAGE_VERSION=\"${VERSION}\"
|
|
|
|
CFLAGS+= -I${.OBJDIR}
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# FreeBSD/arm has some limitations.
|
2004-08-07 03:09:28 +00:00
|
|
|
.if ${MACHINE_ARCH} == "arm"
|
|
|
|
WARNS?= 3
|
|
|
|
.else
|
|
|
|
WARNS?= 6
|
|
|
|
.endif
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# Headers to be installed in /usr/include
|
2004-08-07 03:09:28 +00:00
|
|
|
INCS= archive.h archive_entry.h
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# C sources to be compiled. This is one part of SRCS below.
|
|
|
|
BASE_SRCS= archive_check_magic.c \
|
2004-08-07 03:09:28 +00:00
|
|
|
archive_entry.c \
|
|
|
|
archive_read.c \
|
|
|
|
archive_read_data_into_buffer.c \
|
|
|
|
archive_read_data_into_fd.c \
|
|
|
|
archive_read_extract.c \
|
|
|
|
archive_read_open_fd.c \
|
|
|
|
archive_read_open_file.c \
|
|
|
|
archive_read_support_compression_all.c \
|
|
|
|
archive_read_support_compression_bzip2.c \
|
|
|
|
archive_read_support_compression_compress.c \
|
|
|
|
archive_read_support_compression_gzip.c \
|
|
|
|
archive_read_support_compression_none.c \
|
|
|
|
archive_read_support_format_all.c \
|
|
|
|
archive_read_support_format_cpio.c \
|
2005-01-02 05:21:15 +00:00
|
|
|
archive_read_support_format_iso9660.c \
|
2004-08-07 03:09:28 +00:00
|
|
|
archive_read_support_format_tar.c \
|
2006-01-26 05:28:56 +00:00
|
|
|
archive_read_support_format_tp.c \
|
2005-01-25 06:07:28 +00:00
|
|
|
archive_read_support_format_zip.c \
|
2004-08-07 03:09:28 +00:00
|
|
|
archive_string.c \
|
|
|
|
archive_string_sprintf.c \
|
|
|
|
archive_util.c \
|
|
|
|
archive_write.c \
|
|
|
|
archive_write_open_fd.c \
|
|
|
|
archive_write_open_file.c \
|
|
|
|
archive_write_set_compression_bzip2.c \
|
|
|
|
archive_write_set_compression_gzip.c \
|
|
|
|
archive_write_set_compression_none.c \
|
|
|
|
archive_write_set_format.c \
|
|
|
|
archive_write_set_format_by_name.c \
|
|
|
|
archive_write_set_format_cpio.c \
|
|
|
|
archive_write_set_format_pax.c \
|
|
|
|
archive_write_set_format_shar.c \
|
|
|
|
archive_write_set_format_ustar.c
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# Note: archive.h does need to be in SRCS, since it is built
|
|
|
|
# from archive.h.in. But it does not get included in DIST_FILES
|
|
|
|
# below, so I build up SRCS in two steps.
|
|
|
|
SRCS= ${BASE_SRCS} archive.h
|
|
|
|
|
|
|
|
# Man pages to be installed.
|
2004-08-07 03:09:28 +00:00
|
|
|
MAN= archive_entry.3 \
|
|
|
|
archive_read.3 \
|
|
|
|
archive_util.3 \
|
|
|
|
archive_write.3 \
|
|
|
|
libarchive.3 \
|
|
|
|
libarchive-formats.5 \
|
|
|
|
tar.5
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# Symlink the man pages under each function name.
|
2004-08-07 03:09:28 +00:00
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_add_entry.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_add_entry_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_clear.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_count.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_next.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_next_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_reset.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_acl_text_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_clear.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_clone.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_fflags_text_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_gname_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_hardlink_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_pathname_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_stat.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_symlink_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_copy_uname_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_fflags.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_fflags_text.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_free.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_gid.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_gname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_gname_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_hardlink.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_ino.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_mode.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_mtime.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_mtime_nsec.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_new.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_pathname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_pathname_w.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_rdev.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_rdevmajor.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_rdevminor.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_fflags.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_gid.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_gname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_hardlink.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_link.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_mode.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_pathname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_rdevmajor.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_rdevminor.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_size.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_symlink.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_uid.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_set_uname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_size.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_stat.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_symlink.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_uid.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_uname.3
|
|
|
|
MLINKS+= archive_entry.3 archive_entry_uname_w.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_data.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_data_block.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_data_into_buffer.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_data_into_fd.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_data_skip.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_extract.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_extract_set_progress_callback.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_finish.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_new.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_next_header.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_open.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_open_fd.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_open_file.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_set_bytes_per_block.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_compression_all.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_compression_bzip2.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_compression_compress.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_compression_gzip.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_compression_none.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_format_all.3
|
|
|
|
MLINKS+= archive_read.3 archive_read_support_format_cpio.3
|
2005-01-08 19:51:04 +00:00
|
|
|
MLINKS+= archive_read.3 archive_read_support_format_iso9660.3
|
2004-08-07 03:09:28 +00:00
|
|
|
MLINKS+= archive_read.3 archive_read_support_format_tar.3
|
2005-01-25 06:07:28 +00:00
|
|
|
MLINKS+= archive_read.3 archive_read_support_format_zip.3
|
2004-08-07 03:09:28 +00:00
|
|
|
MLINKS+= archive_util.3 archive_compression.3
|
|
|
|
MLINKS+= archive_util.3 archive_compression_name.3
|
|
|
|
MLINKS+= archive_util.3 archive_errno.3
|
|
|
|
MLINKS+= archive_util.3 archive_error_string.3
|
|
|
|
MLINKS+= archive_util.3 archive_format.3
|
|
|
|
MLINKS+= archive_util.3 archive_format_name.3
|
2004-11-05 05:38:15 +00:00
|
|
|
MLINKS+= archive_util.3 archive_set_error.3
|
2004-08-07 03:09:28 +00:00
|
|
|
MLINKS+= archive_write.3 archive_write_data.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_finish.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_header.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_new.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_open.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_open_fd.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_open_file.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_prepare.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_bytes_per_block.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_bytes_in_last_block.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_callbacks.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_compression_bzip2.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_compression_gzip.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_format_pax.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_format_shar.3
|
|
|
|
MLINKS+= archive_write.3 archive_write_set_format_ustar.3
|
|
|
|
MLINKS+= libarchive.3 archive.3
|
|
|
|
|
2005-10-13 05:51:38 +00:00
|
|
|
# Build archive.h from archive.h.in by substituting version information.
|
2004-11-05 05:29:36 +00:00
|
|
|
archive.h: archive.h.in Makefile
|
2004-08-07 03:09:28 +00:00
|
|
|
cat ${.CURDIR}/archive.h.in | \
|
2005-10-13 05:51:38 +00:00
|
|
|
sed 's/@VERSION@/${VERSION}/g' | \
|
|
|
|
sed 's/@SHLIB_MAJOR@/${SHLIB_MAJOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_MAJOR@/${ARCHIVE_API_MAJOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_MINOR@/${ARCHIVE_API_MINOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_REVISION@/${ARCHIVE_API_REVISION}/g' | \
|
2004-08-07 03:09:28 +00:00
|
|
|
cat > archive.h
|
|
|
|
|
2004-09-01 05:06:42 +00:00
|
|
|
# archive.h needs to be cleaned
|
|
|
|
CLEANFILES+= archive.h
|
|
|
|
|
|
|
|
#
|
|
|
|
# Voodoo for building a distfile that uses autoconf/automake/etc.
|
|
|
|
#
|
|
|
|
|
2004-08-07 03:09:28 +00:00
|
|
|
# Files that just get copied to the distfile build directory
|
|
|
|
DIST_WORK_DIR= ${.OBJDIR}/lib${LIB}-${VERSION}
|
2004-09-01 05:06:42 +00:00
|
|
|
CLEANDIRS+= ${DIST_WORK_DIR}
|
2004-08-07 03:09:28 +00:00
|
|
|
DISTFILE= lib${LIB}-${VERSION}.tar.gz
|
2005-10-13 05:51:38 +00:00
|
|
|
# DIST_FILES is the list of files to include in the distribution.
|
|
|
|
DIST_FILES= ${BASE_SRCS}
|
2004-08-07 03:09:28 +00:00
|
|
|
DIST_FILES+= ${MAN}
|
|
|
|
DIST_FILES+= archive.h.in
|
|
|
|
DIST_FILES+= archive_entry.h archive_platform.h
|
|
|
|
DIST_FILES+= archive_private.h archive_string.h
|
|
|
|
DIST_FILES+= Makefile.am
|
|
|
|
|
|
|
|
distfile:
|
|
|
|
rm -rf ${DIST_WORK_DIR}
|
|
|
|
mkdir ${DIST_WORK_DIR}
|
2005-10-13 05:51:38 +00:00
|
|
|
# Copy the DIST_FILES; ignore errors, don't preserve permissions.
|
|
|
|
for f in ${DIST_FILES}; do \
|
|
|
|
cat ${.CURDIR}/$$f >${DIST_WORK_DIR}/$$f || true; \
|
2004-08-07 03:09:28 +00:00
|
|
|
done
|
2005-10-13 05:51:38 +00:00
|
|
|
# Build configure.ac from configure.ac.in
|
|
|
|
cat ${.CURDIR}/configure.ac.in | \
|
|
|
|
sed 's/@VERSION@/${VERSION}/g' | \
|
|
|
|
sed 's/@SHLIB_MAJOR@/${SHLIB_MAJOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_MAJOR@/${ARCHIVE_API_MAJOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_MINOR@/${ARCHIVE_API_MINOR}/g' | \
|
|
|
|
sed 's/@ARCHIVE_API_REVISION@/${ARCHIVE_API_REVISION}/g' | \
|
2004-08-07 03:09:28 +00:00
|
|
|
cat > ${DIST_WORK_DIR}/configure.ac
|
2005-10-13 05:51:38 +00:00
|
|
|
# Prepare some auxiliary files.
|
|
|
|
(cd ${DIST_WORK_DIR} && libtoolize)
|
2005-04-23 17:56:34 +00:00
|
|
|
(cd ${DIST_WORK_DIR} && aclocal && autoheader)
|
2005-10-13 05:51:38 +00:00
|
|
|
# Build the configure script and portable Makefile
|
2005-04-23 17:56:34 +00:00
|
|
|
(cd ${DIST_WORK_DIR} && autoconf && automake -a --foreign)
|
2005-10-13 05:51:38 +00:00
|
|
|
# Now, use automake-generated Makefile to build the final dist file.
|
2004-08-07 03:09:28 +00:00
|
|
|
(cd ${DIST_WORK_DIR} && ./configure && make distcheck && make dist)
|
|
|
|
mv ${DIST_WORK_DIR}/${DISTFILE} ${.OBJDIR}
|
|
|
|
@echo ==================================================
|
|
|
|
@echo Created ${.OBJDIR}/${DISTFILE}
|
|
|
|
@echo ==================================================
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|