Generate strongSwan SWID tag
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 2 Sep 2013 11:08:41 +0000 (13:08 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 2 Sep 2013 11:08:41 +0000 (13:08 +0200)
src/libpts/plugins/imc_swid/.gitignore [new file with mode: 0644]
src/libpts/plugins/imc_swid/Makefile.am
src/libpts/plugins/imc_swid/regid.2004-03.org.strongswan_strongSwan.swidtag.in [new file with mode: 0644]

diff --git a/src/libpts/plugins/imc_swid/.gitignore b/src/libpts/plugins/imc_swid/.gitignore
new file mode 100644 (file)
index 0000000..f781402
--- /dev/null
@@ -0,0 +1 @@
+*.swidtag
index 8c44105..f5bf975 100644 (file)
@@ -1,3 +1,20 @@
+regid = regid.2004-03.org.strongswan
+unique_sw_id = strongSwan-$(PACKAGE_VERSION_MAJOR)-$(PACKAGE_VERSION_MINOR)-$(PACKAGE_VERSION_BUILD)$(PACKAGE_VERSION_REVIEW)
+swid_tag = $(regid)_$(unique_sw_id).swidtag
+
+ipsec_SCRIPTS = $(swid_tag)
+EXTRA_DIST = $(regid)_strongSwan.swidtag.in
+CLEANFILES = $(regid)_strongSwan*.swidtag
+
+$(swid_tag) : regid.2004-03.org.strongswan_strongSwan.swidtag.in
+       $(AM_V_GEN) \
+       sed \
+       -e "s:@VERSION_MAJOR@:$(PACKAGE_VERSION_MAJOR):" \
+       -e "s:@VERSION_MINOR@:$(PACKAGE_VERSION_MINOR):" \
+       -e "s:@VERSION_BUILD@:$(PACKAGE_VERSION_BUILD):" \
+       -e "s:@VERSION_REVIEW@:$(PACKAGE_VERSION_REVIEW):" \
+       $(srcdir)/$(regid)_strongSwan.swidtag.in > $@
+
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan \
        -I$(top_srcdir)/src/libtncif \
@@ -17,3 +34,10 @@ imc_swid_la_LIBADD = \
 imc_swid_la_SOURCES = imc_swid.c imc_swid_state.h imc_swid_state.c
 
 imc_swid_la_LDFLAGS = -module -avoid-version
+
+install-data-hook:
+       chmod a-x $(DESTDIR)$(ipsecdir)/$(swid_tag)
+
+uninstall-hook:
+       rm $(DESTDIR)$(ipsecdir)/*.swidtag
+
diff --git a/src/libpts/plugins/imc_swid/regid.2004-03.org.strongswan_strongSwan.swidtag.in b/src/libpts/plugins/imc_swid/regid.2004-03.org.strongswan_strongSwan.swidtag.in
new file mode 100644 (file)
index 0000000..6945d87
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<software_identification_tag xmlns="http://standards.iso.org/iso/19770/-2/2009/schema.xsd">
+  <entitlement_required_indicator>true</entitlement_required_indicator>
+  <product_title>strongSwan</product_title>
+  <product_version>
+    <name>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_BUILD@@VERSION_REVIEW@</name>
+    <numeric>
+      <major>@VERSION_MAJOR@</major>
+      <minor>@VERSION_MINOR@</minor>
+      <build>@VERSION_BUILD@</build>
+      <review>@VERSION_REVIEW@</review>
+    </numeric>
+  </product_version>
+  <software_creator>
+    <name>strongSwan Project</name>
+    <regid>regid.2004-03.org.strongswan</regid>
+  </software_creator>
+  <software_licensor>
+    <name>strongSwan Project</name>
+    <regid>regid.2004-03.org.strongswan</regid>
+  </software_licensor>
+  <software_id>
+    <unique_id>strongSwan-@VERSION_MAJOR@-@VERSION_MINOR@-@VERSION_BUILD@@VERSION_REVIEW@</unique_id>
+    <tag_creator_regid>regid.2004-03.org.strongswan</tag_creator_regid>
+  </software_id>
+  <tag_creator>
+    <name>strongSwan Project</name>
+    <regid>regid.2004-03.org.strongswan</regid>
+  </tag_creator>
+</software_identification_tag>