From 14af8e3b75105a9cad35beceac10b80e7cfbf3cf394499cfe8e81c74fa3e8ebe Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 8 Sep 2012 07:16:56 +0000 Subject: [PATCH] Accepting request 133335 from home:jengelh:dev OBS-URL: https://build.opensuse.org/request/show/133335 OBS-URL: https://build.opensuse.org/package/show/security/libseccomp?expand=0&rev=1 --- .gitattributes | 23 + .gitignore | 1 + ...d-use-ac-variables-in-pkgconfig-file.patch | 36 + 0001-build-use-autotools-as-build-system.diff | 1189 +++++++++++++++++ libseccomp-1.0.0+AM.tar.xz | 3 + libseccomp.changes | 4 + libseccomp.spec | 104 ++ 7 files changed, 1360 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-build-use-ac-variables-in-pkgconfig-file.patch create mode 100644 0001-build-use-autotools-as-build-system.diff create mode 100644 libseccomp-1.0.0+AM.tar.xz create mode 100644 libseccomp.changes create mode 100644 libseccomp.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-build-use-ac-variables-in-pkgconfig-file.patch b/0001-build-use-ac-variables-in-pkgconfig-file.patch new file mode 100644 index 0000000..239572e --- /dev/null +++ b/0001-build-use-ac-variables-in-pkgconfig-file.patch @@ -0,0 +1,36 @@ +From 788415e60f153bdf438c70ada9d294da95ef16e0 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Sat, 8 Sep 2012 05:55:42 +0200 +Subject: [PATCH] build: use ac variables in pkgconfig file + +Signed-off-by: Jan Engelhardt +--- + libseccomp.pc.in | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/libseccomp.pc.in b/libseccomp.pc.in +index c195831..a863351 100644 +--- a/libseccomp.pc.in ++++ b/libseccomp.pc.in +@@ -19,13 +19,14 @@ + # along with this library; if not, see . + # + +-prefix=%%INSTALL_PREFIX%% +-libdir=%%INSTALL_LIBDIR%% +-includedir=${prefix}/include ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ + + Name: libseccomp + Description: The enhanced seccomp library + URL: http://libseccomp.sf.net +-Version: %%VERSION_RELEASE%% ++Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} + Libs: -L${libdir} -lseccomp +-- +1.7.7 + diff --git a/0001-build-use-autotools-as-build-system.diff b/0001-build-use-autotools-as-build-system.diff new file mode 100644 index 0000000..ece5f8b --- /dev/null +++ b/0001-build-use-autotools-as-build-system.diff @@ -0,0 +1,1189 @@ +# This patch is provided in the Build System package merely for +# reference. It was applied to the upstream tarball (and autogen.sh +# be run), creating libseccomp-1.0.0+AM.tar.xz. +# +From c6e2115b4c9bcca32206b57b510eed3f71b42ca7 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Sat, 8 Sep 2012 05:21:32 +0200 +Subject: [PATCH] build: use autotools as build system + +Signed-off-by: Jan Engelhardt +--- + .gitignore | 25 ++++-- + Makefile | 111 ----------------------- + Makefile.am | 23 +++++ + autogen.sh | 5 + + configure | 252 ----------------------------------------------------- + configure.ac | 24 +++++ + doc/Makefile | 60 ------------- + include/Makefile | 47 ---------- + install.mk | 31 ------- + m4/.gitignore | 2 + + macros.mk | 181 -------------------------------------- + src/Makefile | 67 -------------- + src/Makefile.am | 6 ++ + src/system.h | 4 +- + tests/Makefile | 76 ---------------- + tests/Makefile.am | 26 ++++++ + tools/Makefile | 56 ------------ + tools/Makefile.am | 6 ++ + version_info | 8 -- + 19 files changed, 111 insertions(+), 899 deletions(-) + delete mode 100644 Makefile + create mode 100644 Makefile.am + create mode 100755 autogen.sh + delete mode 100755 configure + create mode 100644 configure.ac + delete mode 100644 doc/Makefile + delete mode 100644 include/Makefile + delete mode 100644 install.mk + create mode 100644 m4/.gitignore + delete mode 100644 macros.mk + delete mode 100644 src/Makefile + create mode 100644 src/Makefile.am + delete mode 100644 tests/Makefile + create mode 100644 tests/Makefile.am + delete mode 100644 tools/Makefile + create mode 100644 tools/Makefile.am + delete mode 100644 version_info + +diff --git a/.gitignore b/.gitignore +index d01d1a1..ef9560e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,16 +1,25 @@ + *~ +-*.a ++*.la ++*.lo + *.o +-*.d +-*.dtmp ++*.pc + *.swp + *.orig ++.deps ++.dirstamp ++.libs + .stgit-* + .stgitmail.txt ++Makefile ++Makefile.in + cscope.* + tags +-configure.h +-configure.mk +-version_info.mk +-version.h +-libseccomp.pc ++ ++/autom4te.cache/ ++/aclocal.m4 ++/build-aux/ ++/config.* ++/configure ++/configure.h* ++/libtool ++/stamp-h1 +diff --git a/Makefile b/Makefile +deleted file mode 100644 +index 5f7aa9b..0000000 +--- a/Makefile ++++ /dev/null +@@ -1,111 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include macros.mk +- +-# +-# configuration +-# +- +--include version_info.mk +--include configure.mk +-include install.mk +- +-# +-# targets +-# +- +-CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc +-SUBDIRS_BUILD = src tests tools +-SUBDIRS_INSTALL = src include doc +- +-.PHONY: tarball install ctags cstags clean dist-clean $(SUBDIRS_BUILD) +- +-all: $(SUBDIRS_BUILD) +- +-$(CONFIGS): version_info +- @$(ECHO) ">> INFO: automatically generating configuration ..." +- @./configure +- +-tarball: clean +- @ver=$(VERSION_RELEASE); \ +- tarball=libseccomp-$$ver.tar.gz; \ +- $(ECHO) ">> INFO: creating the tarball ../$$tarball"; \ +- tmp_dir=$$(mktemp -d /tmp/libseccomp.XXXXX); \ +- rel_dir=$$tmp_dir/libseccomp-$$ver; \ +- $(MKDIR) $$rel_dir; \ +- $(TAR) cf - --exclude=*~ --exclude=.git* --exclude=.stgit* . | \ +- (cd $$rel_dir; tar xf -); \ +- (cd $$tmp_dir; $(TAR) zcf $$tarball libseccomp-$$ver); \ +- $(MV) $$tmp_dir/$$tarball ..; \ +- $(RM) -rf $$tmp_dir; +- +-$(VERSION_HDR): version_info.mk +- @$(ECHO) ">> INFO: creating the version header file" +- @hdr="$(VERSION_HDR)"; \ +- $(ECHO) "/* automatically generated - do not edit */" > $$hdr; \ +- $(ECHO) "#ifndef _VERSION_H" >> $$hdr; \ +- $(ECHO) "#define _VERSION_H" >> $$hdr; \ +- $(ECHO) "#define VERSION_RELEASE \"$(VERSION_RELEASE)\"" >> $$hdr; \ +- $(ECHO) "#endif" >> $$hdr; +- +-src: $(VERSION_HDR) $(CONFIGS) +- @$(ECHO) ">> INFO: building in directory $@/ ..." +- @$(MAKE) -C $@ +- +-tests: src +- @$(ECHO) ">> INFO: building in directory $@/ ..." +- @$(MAKE) -C $@ +- +-tools: src +- @$(ECHO) ">> INFO: building in directory $@/ ..." +- @$(MAKE) -C $@ +- +-install: $(SUBDIRS_BUILD) +- @$(ECHO) ">> INFO: installing in $(INSTALL_PREFIX) ..." +- $(INSTALL_PC_MACRO) libseccomp.pc +- @for dir in $(SUBDIRS_INSTALL); do \ +- $(ECHO) ">> INFO: installing from $$dir/"; \ +- $(MAKE) -C $$dir install; \ +- done +- +-ctags: +- @$(ECHO) ">> INFO: generating ctags for the project ..." +- @ctags -R * +- +-cstags: +- @$(ECHO) ">> INFO: generating cscope tags for the project ..." +- @find -iname *.[ch] > cscope.files +- @cscope -b -q -k +- +-clean: +- @$(ECHO) ">> INFO: cleaning up libseccomp" +- @for dir in $(SUBDIRS_BUILD); do \ +- $(MAKE) -C $$dir clean; \ +- done +- +-dist-clean: clean +- @$(ECHO) ">> INFO: removing the configuration files" +- @$(RM) $(CONFIGS) +diff --git a/Makefile.am b/Makefile.am +new file mode 100644 +index 0000000..9e3b63d +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,23 @@ ++# -*- Makefile -*- ++ ++SUBDIRS = src tools tests ++ ++ACLOCAL_AMFLAGS = -I m4 ++ ++pkgconfdir = ${libdir}/pkgconfig ++pkgconf_DATA = libseccomp.pc ++ ++include_HEADERS = include/seccomp.h ++ ++man_MANS = \ ++ doc/man/man3/seccomp_attr_get.3 \ ++ doc/man/man3/seccomp_attr_set.3 \ ++ doc/man/man3/seccomp_export_bpf.3 \ ++ doc/man/man3/seccomp_export_pfc.3 \ ++ doc/man/man3/seccomp_init.3 \ ++ doc/man/man3/seccomp_load.3 \ ++ doc/man/man3/seccomp_release.3 \ ++ doc/man/man3/seccomp_reset.3 \ ++ doc/man/man3/seccomp_rule_add.3 \ ++ doc/man/man3/seccomp_rule_add_exact.3 \ ++ doc/man/man3/seccomp_syscall_priority.3 +diff --git a/autogen.sh b/autogen.sh +new file mode 100755 +index 0000000..278050e +--- /dev/null ++++ b/autogen.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++autoreconf -fi; ++rm -Rf autom4te.cache; ++# do not call configure - this is unexpected +diff --git a/configure b/configure +deleted file mode 100755 +index e11dea6..0000000 +--- a/configure ++++ /dev/null +@@ -1,252 +0,0 @@ +-#!/bin/bash +- +-# +-# Enhanced Seccomp Library Configure Script +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# configuration defaults +-opt_prefix="/usr/local" +-opt_libdir="" +-opt_sysinc_seccomp="yes" +- +-# output files +-cnf_mk_file="configure.mk" +-cnf_h_file="configure.h" +- +-#### +-# functions +- +-function verify_deps() { +- [[ -z "$1" ]] && return +- if ! which "$1" >& /dev/null; then +- echo "error: install \"$1\" and include it in your \$PATH" +- exit 1 +- fi +-} +- +-function msg_usage() { +- cat << EOF +-Configure the enhanced seccomp library, libseccomp, for this system. +- +-Usage: +- ./configure +- +-Options: +-* general configuration +- -h, --help display this help and exit +-* installation configuration +- --prefix=PREFIX installation base [/usr/local] +- --libdir=DIR library directory [/usr/local/lib] +-EOF +-} +- +-function msg_summary() { +- cat << EOF +- CONFIGURATION SUMMARY +- libseccomp version: ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO} +- installation base: $opt_prefix +- library directory: $opt_libdir +- use system includes: $opt_sysinc_seccomp +-EOF +-} +- +-function msg_error() { +- echo "error: $@" +-} +- +-function cnf_mk_header() { +- echo "# generated by configure on $(date -R)" >> $cnf_mk_file +- echo "# options: \"$opt_str\"" >> $cnf_mk_file +- echo "" >> $cnf_mk_file +-} +- +-function cnf_mk_footer() { +- echo "" >> $cnf_mk_file +-} +- +-function cnf_mk_entry() { +- [[ $# -ne 2 ]] && return +- case "$2" in +- no) +- echo "$1 = 0" >> $cnf_mk_file +- ;; +- yes) +- echo "$1 = 1" >> $cnf_mk_file +- ;; +- *) +- echo "$1 = \"$2\"" >> $cnf_mk_file +- esac +-} +- +-function cnf_h_header() { +- echo "/* generated by configure on $(date -R) */" >> $cnf_h_file +- echo "/* options: \"$opt_str\" */" >> $cnf_h_file +- echo "" >> $cnf_h_file +- echo "#ifndef _CONFIGURE_H" >> $cnf_h_file +- echo "#define _CONFIGURE_H" >> $cnf_h_file +- echo "" >> $cnf_h_file +-} +- +-function cnf_h_footer() { +- echo "" >> $cnf_h_file +- echo "#endif" >> $cnf_h_file +- echo "" >> $cnf_h_file +-} +- +-function cnf_h_entry() { +- [[ $# -ne 2 ]] && return +- case "$2" in +- no) +- echo "#undef $1" >> $cnf_h_file +- ;; +- yes) +- echo "#define $1 1" >> $cnf_h_file +- ;; +- *) +- echo "#define $1 $2" >> $cnf_h_file +- esac +-} +- +-function cnf_reset() { +- cat /dev/null > $cnf_mk_file +- cat /dev/null > $cnf_h_file +-} +- +-function cnf_header() { +- cnf_mk_header +- cnf_h_header +-} +- +-function cnf_entry() { +- cnf_mk_entry "$1" "$2" +- cnf_h_entry "$1" "$2" +-} +- +-function cnf_footer() { +- cnf_mk_footer +- cnf_h_footer +-} +- +-function tmpl_filter() { +- name="echo \$$1" +- val="$(eval $name)" +- cat - | sed -e 's/%%'"$1"'%%/'"${val//\//\\/}"'/g;' +-} +- +-#### +-# main +- +-# +-# setup +-# +- +-# verify script dependencies +-verify_deps getopt +- +-# parse the command line options +-opt_str="$@" +-opt=$(getopt -n "$0" --options "h" --longoptions "help,prefix:,libdir:" -- "$@") +-eval set -- "$opt" +-while [[ $# -gt 0 ]]; do +- case "$1" in +- --prefix) +- opt_prefix="$2" +- shift 2 +- ;; +- --libdir) +- opt_libdir="$2" +- shift 2 +- ;; +- -h|--help) +- msg_usage +- exit 0 +- ;; +- --) +- shift +- ;; +- *) +- msg_usage +- exit 1 +- esac +-done +- +-# validate the options +-if [[ -e "$opt_prefix" && ! -d "$opt_prefix" ]]; then +- msg_error "install prefix ($opt_prefix) is not a directory" +- exit 1 +-fi +-if [[ -z $opt_libdir ]]; then +- opt_libdir="$opt_prefix/lib" +-fi +-if [[ -e "$opt_libdir" && ! -d "$opt_libdir" ]]; then +- msg_error "libdir ($opt_libdir) is not a directory" +- exit 1 +-fi +- +-# +-# automatic configuration +-# +- +-# system seccomp includes +-if [[ -r "/usr/include/linux/seccomp.h" ]]; then +- opt_sysinc_seccomp="yes" +-else +- opt_sysinc_seccomp="no" +-fi +- +-# generate the version files +-. ./version_info +-VERSION_RELEASE="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}" +-rm -f ./version_info.mk +-echo "# generated by configure on $(date -R)" >> ./version_info.mk +-echo "VERSION_MAJOR=$VERSION_MAJOR" >> ./version_info.mk +-echo "VERSION_MINOR=$VERSION_MINOR" >> ./version_info.mk +-echo "VERSION_MICRO=$VERSION_MICRO" >> ./version_info.mk +-echo "VERSION_RELEASE=$VERSION_RELEASE" >> ./version_info.mk +- +-# generate the pkg-config metadata +-INSTALL_PREFIX="$opt_prefix" +-INSTALL_LIBDIR="$opt_libdir" +-rm -f ./libseccomp.pc +-cat ./libseccomp.pc.in | \ +- tmpl_filter INSTALL_PREFIX | \ +- tmpl_filter INSTALL_LIBDIR | \ +- tmpl_filter VERSION_RELEASE \ +- >> ./libseccomp.pc +- +-# +-# finish +-# +- +-# reset the configuration files +-cnf_reset +-cnf_header +- +-# output the configuration files +-cnf_mk_entry "CONF_INSTALL_PREFIX" "$opt_prefix" +-cnf_mk_entry "CONF_INSTALL_LIBDIR" "$opt_libdir" +-cnf_entry "CONF_SYSINC_SECCOMP" "$opt_sysinc_seccomp" +- +-# configuration footer +-cnf_footer +- +-# display a summary and exit +-msg_summary +-exit 0 +diff --git a/configure.ac b/configure.ac +new file mode 100644 +index 0000000..27a7f26 +--- /dev/null ++++ b/configure.ac +@@ -0,0 +1,24 @@ ++AC_INIT([libseccomp], [1.0.0]) ++AC_CONFIG_AUX_DIR([build-aux]) ++AC_CONFIG_HEADERS([configure.h]) ++AC_CONFIG_MACRO_DIR([m4]) ++AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz]) ++AC_PROG_CC ++AM_PROG_CC_C_O ++m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) ++m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) ++AC_DISABLE_STATIC ++LT_INIT ++ ++AC_CHECK_HEADER([linux/seccomp.h]) ++ ++AM_CPPFLAGS="-I\${top_srcdir}/include" ++AM_CFLAGS="-Wall" ++AM_LDFLAGS="-Wl,-z -Wl,relro" ++AC_SUBST([AM_CPPFLAGS]) ++AC_SUBST([AM_CFLAGS]) ++AC_SUBST([AM_LDFLAGS]) ++ ++AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile ++ tests/Makefile libseccomp.pc]) ++AC_OUTPUT +diff --git a/doc/Makefile b/doc/Makefile +deleted file mode 100644 +index c6d3f52..0000000 +--- a/doc/Makefile ++++ /dev/null +@@ -1,60 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include ../macros.mk +- +-# +-# configuration +-# +- +-include $(TOPDIR)/version_info.mk +-include $(TOPDIR)/configure.mk +-include $(TOPDIR)/install.mk +- +-MAN3 = \ +- man/man3/seccomp_init.3 \ +- man/man3/seccomp_load.3 \ +- man/man3/seccomp_release.3 \ +- man/man3/seccomp_reset.3 \ +- man/man3/seccomp_rule_add.3 \ +- man/man3/seccomp_rule_add_exact.3 \ +- man/man3/seccomp_syscall_priority.3 \ +- man/man3/seccomp_export_bpf.3 \ +- man/man3/seccomp_export_pfc.3 \ +- man/man3/seccomp_attr_set.3 \ +- man/man3/seccomp_attr_get.3 +- +-# +-# targets +-# +- +-.PHONY: all install install_man3 +- +-all: +- +-install: install_man3 +- +-install_man3: $(MAN3) +- $(INSTALL_MAN3_MACRO) +diff --git a/include/Makefile b/include/Makefile +deleted file mode 100644 +index 2cd0e56..0000000 +--- a/include/Makefile ++++ /dev/null +@@ -1,47 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include ../macros.mk +- +-# +-# configuration +-# +- +-include $(TOPDIR)/version_info.mk +-include $(TOPDIR)/configure.mk +-include $(TOPDIR)/install.mk +- +-# +-# targets +-# +- +-.PHONY: all install install_hdr +- +-all: +- +-install: install_hdr +- +-install_hdr: seccomp.h +- $(INSTALL_INC_MACRO) +diff --git a/install.mk b/install.mk +deleted file mode 100644 +index 123af33..0000000 +--- a/install.mk ++++ /dev/null +@@ -1,31 +0,0 @@ +-# +-# Enhanced Seccomp Library Installation Defaults +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-INSTALL_PREFIX ?= $(CONF_INSTALL_PREFIX) +- +-INSTALL_SBIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/sbin +-INSTALL_BIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/bin +-INSTALL_LIB_DIR ?= $(DESTDIR)/$(CONF_INSTALL_LIBDIR) +-INSTALL_INC_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/include +-INSTALL_MAN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/share/man +- +-INSTALL_OWNER ?= $$(id -u) +-INSTALL_GROUP ?= $$(id -g) +diff --git a/m4/.gitignore b/m4/.gitignore +new file mode 100644 +index 0000000..64d9bbc +--- /dev/null ++++ b/m4/.gitignore +@@ -0,0 +1,2 @@ ++/libtool.m4 ++/lt*.m4 +diff --git a/macros.mk b/macros.mk +deleted file mode 100644 +index 6162900..0000000 +--- a/macros.mk ++++ /dev/null +@@ -1,181 +0,0 @@ +-# +-# Enhanced Seccomp Library Build Macros +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-SHELL = /bin/bash +- +-# +-# simple /bin/bash script to find the top of the tree +-# +- +-TOPDIR := $(shell \ +- ftd() { \ +- cd $$1; \ +- if [[ -r "macros.mk" ]]; then \ +- pwd; \ +- else \ +- ftd "../"; \ +- fi \ +- }; \ +- ftd .) +- +-# +-# build configuration +-# +- +-V ?= 0 +- +-CPPFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include +-LIBFLAGS = +- +-CFLAGS ?= -Wl,-z,relro -Wall -O0 -g +-CFLAGS += -fPIC +-LDFLAGS ?= -z relro -g +- +-# +-# build tools +-# +- +-LN ?= ln +-MV ?= mv +-CAT ?= cat +-ECHO ?= echo +-TAR ?= tar +-MKDIR ?= mkdir +- +-SED ?= sed +-AWK ?= awk +- +-# we require gcc specific functionality +-GCC ?= gcc +- +-INSTALL ?= install +- +-# +-# auto dependencies +-# +- +-MAKEDEP = @$(GCC) $(CPPFLAGS) -MM -MF $(patsubst %.o,%.d,$@) $<; +-MAKEDEP_EXEC = \ +- @$(GCC) $(CPPFLAGS) -MM -MT $(patsubst %.d,%,$@) \ +- -MF $@ $(patsubst %.d,%.c,$@); +- +-ADDDEP = \ +- @adddep_func() { \ +- $(MV) $$1 $$1.dtmp; \ +- $(CAT) $$1.dtmp | $(SED) -e 's/\([^\]\)$$/\1 \\/' | \ +- ( $(CAT) - && $(ECHO) " $$2" ) > $$1; \ +- $(RM) -f $@.dtmp; \ +- }; \ +- adddep_func +- +-# +-# build constants +-# +- +-VERSION_HDR = version.h +- +-# +-# build macros +-# +- +-ifeq ($(V),0) +- ARCHIVE = @echo " AR $@ (add/update: $?)"; +-endif +-ARCHIVE += $(AR) -cru $@ $?; +- +-ifeq ($(V),0) +- COMPILE = @echo " CC $@"; +-endif +-COMPILE += $(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<; +- +-ifeq ($(V),0) +- COMPILE_EXEC = @echo " CC $@"; +-endif +-COMPILE_EXEC += $(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LDFLAGS); +- +-ifeq ($(V),0) +- LINK_EXEC = @echo " LD $@"; +-endif +-LINK_EXEC += $(GCC) $(LDFLAGS) -o $@ $^ $(LIBFLAGS); +- +-ifeq ($(V),0) +- LINK_LIB = @echo " LD $@" \ +- "($(patsubst %.so.$(VERSION_RELEASE),%.so.$(VERSION_MAJOR),$@))"; +-endif +-LINK_LIB += $(GCC) $(LDFLAGS) -o $@ $^ -shared \ +- -Wl,-soname=$(patsubst %.so.$(VERSION_RELEASE),%.so.$(VERSION_MAJOR),$@) +- +-# +-# install macros +-# +- +-ifeq ($(V),0) +- INSTALL_LIB_MACRO = @echo " INSTALL $^ ($(INSTALL_LIB_DIR)/$^)"; +-endif +-INSTALL_LIB_MACRO += \ +- basename=$$(echo $^ | sed -e 's/.so.*$$/.so/'); \ +- soname=$$(objdump -p $^ | grep "SONAME" | awk '{print $$2}'); \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \ +- -d "$(INSTALL_LIB_DIR)"; \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \ +- $^ "$(INSTALL_LIB_DIR)"; \ +- (cd "$(INSTALL_LIB_DIR)"; $(RM) $$soname); \ +- (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$soname); \ +- (cd "$(INSTALL_LIB_DIR)"; $(RM) $$basname); \ +- (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$basename); +- +-ifeq ($(V),0) +- INSTALL_PC_MACRO = \ +- @echo " INSTALL $$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \ +- " ($(INSTALL_LIB_DIR)/pkgconfig)"; +-endif +-INSTALL_PC_MACRO += \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \ +- -d "$(INSTALL_LIB_DIR)/pkgconfig"; \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \ +- "$$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \ +- "$(INSTALL_LIB_DIR)/pkgconfig"; \# +- +-ifeq ($(V),0) +- INSTALL_INC_MACRO = @echo " INSTALL $^ ($(INSTALL_INC_DIR))"; +-endif +-INSTALL_INC_MACRO += \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \ +- -d "$(INSTALL_INC_DIR)"; \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \ +- $^ "$(INSTALL_INC_DIR)"; +- +-ifeq ($(V),0) +- INSTALL_MAN3_MACRO = @echo " INSTALL manpages ($(INSTALL_MAN_DIR)/man3)"; +-endif +-INSTALL_MAN3_MACRO += \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \ +- -d "$(INSTALL_MAN_DIR)/man3"; \ +- $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \ +- $^ "$(INSTALL_MAN_DIR)/man3"; +- +-# +-# default build targets +-# +- +-%.o: %.c +- $(MAKEDEP) +- $(COMPILE) +diff --git a/src/Makefile b/src/Makefile +deleted file mode 100644 +index 801e814..0000000 +--- a/src/Makefile ++++ /dev/null +@@ -1,67 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include ../macros.mk +- +-# +-# configuration +-# +- +-include $(TOPDIR)/version_info.mk +-include $(TOPDIR)/configure.mk +-include $(TOPDIR)/install.mk +- +-LIB_STATIC = libseccomp.a +-LIB_SHARED = libseccomp.so.$(VERSION_RELEASE) +- +-OBJS = \ +- api.o db.o \ +- arch.o arch-i386.o \ +- hash.o \ +- gen_pfc.o gen_bpf.o +- +-DEPS = $(OBJS:%.o=%.d) +- +-# +-# targets +-# +- +-.PHONY: all install clean +- +-all: $(LIB_STATIC) $(LIB_SHARED) +- +--include $(DEPS) +- +-$(LIB_STATIC): $(OBJS) +- $(ARCHIVE) +- +-$(LIB_SHARED): $(OBJS) +- $(LINK_LIB) +- +-install: $(LIB_SHARED) +- $(INSTALL_LIB_MACRO) +- +-clean: +- $(RM) $(DEPS) $(OBJS) $(LIB_STATIC) $(LIB_SHARED) +diff --git a/src/Makefile.am b/src/Makefile.am +new file mode 100644 +index 0000000..0d53f0d +--- /dev/null ++++ b/src/Makefile.am +@@ -0,0 +1,6 @@ ++# -*- Makefile -*- ++ ++lib_LTLIBRARIES = libseccomp.la ++ ++libseccomp_la_SOURCES = api.c db.c arch.c arch-i386.c \ ++ hash.c gen_pfc.c gen_bpf.c +diff --git a/src/system.h b/src/system.h +index cb14f65..11303cf 100644 +--- a/src/system.h ++++ b/src/system.h +@@ -25,9 +25,9 @@ + #include + #include + +-#include ++#include "configure.h" + +-#ifdef CONF_SYSINC_SECCOMP ++#ifdef HAVE_LINUX_SECCOMP_H + + /* system header file */ + #include +diff --git a/tests/Makefile b/tests/Makefile +deleted file mode 100644 +index ca2a40a..0000000 +--- a/tests/Makefile ++++ /dev/null +@@ -1,76 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include ../macros.mk +- +-# +-# configuration +-# +- +-include $(TOPDIR)/version_info.mk +-include $(TOPDIR)/configure.mk +- +-OBJS = util.o +- +-LDFLAGS := ../src/libseccomp.a $(OBJS) +- +-TESTS = 01-allow \ +- 02-basic \ +- 03-basic-chains \ +- 04-multilevel-chains \ +- 05-long-jumps \ +- 06-actions \ +- 07-db-bug-looping \ +- 08-subtree-checks \ +- 09-syscall-priority-pre \ +- 10-syscall-priority-post \ +- 11-basic-errors \ +- 12-basic-masked-ops \ +- 13-attrs \ +- 14-reset +- +-DEPS_OBJS = $(OBJS:%.o=%.d) +-DEPS_TESTS = $(TESTS:%=%.d) +- +-# +-# targets +-# +- +-.PHONY: clean +- +-all: $(TESTS) $(OBJS) +- +--include $(DEPS_TESTS) $(DEPS_OBJS) +- +-$(DEPS_TESTS): +- $(MAKEDEP_EXEC) +- $(ADDDEP) $@ ../src/libseccomp.a +- $(ADDDEP) $@ $(OBJS) +- +-$(TESTS): +- $(COMPILE_EXEC) +- +-clean: +- $(RM) $(DEPS_TESTS) $(DEPS_OBJS) $(TESTS) $(OBJS) +diff --git a/tests/Makefile.am b/tests/Makefile.am +new file mode 100644 +index 0000000..c66a62b +--- /dev/null ++++ b/tests/Makefile.am +@@ -0,0 +1,26 @@ ++# -*- Makefile -*- ++ ++AM_LDFLAGS = -static ++LDADD = util.la ../src/libseccomp.la ++ ++check_LTLIBRARIES = util.la ++util_la_SOURCES = util.c ++util_la_LDFLAGS = -module ++ ++TESTS = regression ++ ++check_PROGRAMS = \ ++ 01-allow \ ++ 02-basic \ ++ 03-basic-chains \ ++ 04-multilevel-chains \ ++ 05-long-jumps \ ++ 06-actions \ ++ 07-db-bug-looping \ ++ 08-subtree-checks \ ++ 09-syscall-priority-pre \ ++ 10-syscall-priority-post \ ++ 11-basic-errors \ ++ 12-basic-masked-ops \ ++ 13-attrs \ ++ 14-reset +diff --git a/tools/Makefile b/tools/Makefile +deleted file mode 100644 +index bc056d0..0000000 +--- a/tools/Makefile ++++ /dev/null +@@ -1,56 +0,0 @@ +-# +-# Enhanced Seccomp Library Makefile +-# +-# Copyright (c) 2012 Red Hat +-# Author: Paul Moore +-# +- +-# +-# This library is free software; you can redistribute it and/or modify it +-# under the terms of version 2.1 of the GNU Lesser General Public License as +-# published by the Free Software Foundation. +-# +-# This library 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 Lesser General Public License +-# for more details. +-# +-# You should have received a copy of the GNU Lesser General Public License +-# along with this library; if not, see . +-# +- +-# +-# macros +-# +- +-include ../macros.mk +- +-# +-# configuration +-# +- +-include $(TOPDIR)/configure.mk +- +-TOOLS = bpf_disasm \ +- bpf_sim +- +-DEPS = $(TOOLS:%=%.d) +- +-# +-# targets +-# +- +-.PHONY: clean +- +-all: $(TOOLS) +- +--include $(DEPS) +- +-$(DEPS): +- $(MAKEDEP_EXEC) +- +-$(TOOLS): +- $(COMPILE_EXEC) +- +-clean: +- $(RM) $(DEPS) $(TOOLS) +diff --git a/tools/Makefile.am b/tools/Makefile.am +new file mode 100644 +index 0000000..912e942 +--- /dev/null ++++ b/tools/Makefile.am +@@ -0,0 +1,6 @@ ++# -*- Makefile -*- ++ ++noinst_PROGRAMS = bpf_disasm bpf_sim ++ ++bpf_disasm_SOURCES = bpf_disasm.c ++bpf_sim_SOURCES = bpf_sim.c +diff --git a/version_info b/version_info +deleted file mode 100644 +index 7520e4f..0000000 +--- a/version_info ++++ /dev/null +@@ -1,8 +0,0 @@ +-# +-# version_info - version information for seccomp library +-# +- +-# version components +-VERSION_MAJOR=0 +-VERSION_MINOR=0 +-VERSION_MICRO=0 +-- +1.7.7 + diff --git a/libseccomp-1.0.0+AM.tar.xz b/libseccomp-1.0.0+AM.tar.xz new file mode 100644 index 0000000..471d4d9 --- /dev/null +++ b/libseccomp-1.0.0+AM.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17df89b93ee975d1ae203e81e9bece1030d8cf31f228f65d0d4c43d09c7ae801 +size 254748 diff --git a/libseccomp.changes b/libseccomp.changes new file mode 100644 index 0000000..805e553 --- /dev/null +++ b/libseccomp.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Sat Sep 8 03:50:02 UTC 2012 - jengelh@inai.de + +- Initial package (version 1.0.0) for build.opensuse.org diff --git a/libseccomp.spec b/libseccomp.spec new file mode 100644 index 0000000..0d2860b --- /dev/null +++ b/libseccomp.spec @@ -0,0 +1,104 @@ +# +# spec file for package libseccomp +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: libseccomp +%define lname libseccomp0 +Version: 1.0.0 +Release: 0 +Summary: An enhanced Seccomp (mode 2) helper library +License: LGPL-2.1 +Group: Development/Libraries/C and C++ +URL: http://sf.net/projects/seccomp/ + +#DL-URL: http://downloads.sf.net/libseccomp/libseccomp-1.0.0.tar.gz +#Git-Clone: git://git.code.sf.net/p/libseccomp/libseccomp +Source: %name-%version+AM.tar.xz +Patch1: 0001-build-use-ac-variables-in-pkgconfig-file.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: pkgconfig +BuildRequires: xz + +%description +The libseccomp library provides and easy to use, platform +independent, interface to the Linux Kernel's syscall filtering +mechanism: seccomp. The libseccomp API is designed to abstract away +the underlying BPF based syscall filter language and present a more +conventional function-call based filtering interface that should be +familiar to, and easily adopted by application developers. + +%package -n %lname +Summary: An enhanced Seccomp (mode 2) helper library +Group: System/Libraries + +%description -n %lname +The libseccomp library provides and easy to use, platform +independent, interface to the Linux Kernel's syscall filtering +mechanism: seccomp. The libseccomp API is designed to abstract away +the underlying BPF based syscall filter language and present a more +conventional function-call based filtering interface that should be +familiar to, and easily adopted by application developers. + +%package devel +Summary: Development files for libseccomp, an enhanced Seccomp (mode 2) helper library +Group: Development/Libraries/C and C++ +Requires: %lname = %version + +%description devel +The libseccomp library provides and easy to use, platform +independent, interface to the Linux Kernel's syscall filtering +mechanism: seccomp. The libseccomp API is designed to abstract away +the underlying BPF based syscall filter language and present a more +conventional function-call based filtering interface that should be +familiar to, and easily adopted by application developers. + +This package contains the development files for libseccomp. + +%prep +%if 0%{?__xz:1} +%setup -qn %name +%else +tar -xf "%{S:0}" --use=xz; +%setup -DTqn %name +%endif +%patch -P 1 -p1 + +%build +%configure --includedir=%_includedir/%name-%version +make %{?_smp_mflags} + +%install +b="%buildroot"; +make install DESTDIR="$b"; +find "$b/%_libdir" -type f -name "*.la" -delete; + +%post -n %lname -p /sbin/ldconfig + +%postun -n %lname -p /sbin/ldconfig + +%files -n %lname +%defattr(-,root,root) +%_libdir/%name.so.* + +%files devel +%defattr(-,root,root) +%_mandir/man3/seccomp_*.3* +%_includedir/%name-%version +%_libdir/%name.so +%_libdir/pkgconfig/%name.pc + +%changelog