From 4acfa2cd07367e2053c22f7d25a6c0c9ecf4794e Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: May 31 2019 20:32:37 +0000 Subject: Release 1.0.2 Signed-off-by: Robert-André Mauchin --- diff --git a/.gitignore b/.gitignore index 3024767..225b9ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pkcs11-88c9f842544e629ec046105d7fb50d5daafae737.tar.gz +/pkcs11-1.0.2.tar.gz diff --git a/0001-update-test-env-settings.patch b/0001-update-test-env-settings.patch deleted file mode 100644 index 30dd8b5..0000000 --- a/0001-update-test-env-settings.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 704f7e678a3e4ad3e435807782f8c977bf8033ff Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Fri, 9 Oct 2015 11:39:58 +0200 -Subject: [PATCH] update test env settings - ---- - pkcs11_test.go | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/pkcs11_test.go b/pkcs11_test.go -index 0ac02a2..a4d0417 100644 ---- a/pkcs11_test.go -+++ b/pkcs11_test.go -@@ -15,9 +15,8 @@ import ( - ) - - func setenv(t *testing.T) *Ctx { -- wd, _ := os.Getwd() -- os.Setenv("SOFTHSM_CONF", wd+"/softhsm.conf") -- p := New("/usr/lib/softhsm/libsofthsm.so") //p := New("/home/miek/libsofthsm.so") -+ os.Setenv("SOFTHSM_CONF", "/etc/softhsm.conf") -+ p := New("/usr/lib64/softhsm/libsofthsm.so") //p := New("/home/miek/libsofthsm.so") - if p == nil { - t.Fatal("Failed to init lib") - } --- -1.9.3 - diff --git a/Fix-formatting.patch b/Fix-formatting.patch deleted file mode 100644 index 12ef6b3..0000000 --- a/Fix-formatting.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d747f5382d33d2421d3209d7ad993b1e4aa8e3c5 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Sun, 8 Jul 2018 18:56:38 +0200 -Subject: [PATCH] Fix formatting - ---- - pkcs11_test.go | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pkcs11_test.go b/pkcs11_test.go -index a4d0417..58c4932 100644 ---- a/pkcs11_test.go -+++ b/pkcs11_test.go -@@ -36,7 +36,7 @@ func getSession(p *Ctx, t *testing.T) SessionHandle { - t.Fatalf("session %s\n", e.Error()) - } - if e := p.Login(session, CKU_USER, "1234"); e != nil { -- t.Fatal("user pin %s\n", e.Error()) -+ t.Fatalf("user pin %s\n", e.Error()) - } - return session - } -@@ -178,7 +178,7 @@ func testDestroyObject(t *testing.T) { - - p.Logout(session) // log out the normal user - if e := p.Login(session, CKU_SO, "1234"); e != nil { -- t.Fatal("security officer pin %s\n", e.Error()) -+ t.Fatalf("security officer pin %s\n", e.Error()) - } - - // Looking the int values is tricky because they are stored in 64 bits in hsm.db, --- -2.7.5 - diff --git a/golang-github-miekg-pkcs11.spec b/golang-github-miekg-pkcs11.spec index 5c3cdc3..af7040c 100644 --- a/golang-github-miekg-pkcs11.spec +++ b/golang-github-miekg-pkcs11.spec @@ -1,72 +1,74 @@ -# http://github.com/miekg/pkcs11 +# Generated by go2rpm +%bcond_without check +# https://github.com/miekg/pkcs11 %global goipath github.com/miekg/pkcs11 -%global commit 88c9f842544e629ec046105d7fb50d5daafae737 +Version: 1.0.2 +%gometa -%gometa -i +%global godevelheader %{expand: +Requires: libtool-ltdl-devel +Requires: softhsm} + +%global common_description %{expand: +Pkcs11 wrapper for Go.} + +%global golicenses LICENSE +%global godocs README.md + +%global gosupfiles glide.lock glide.yaml Name: %{goname} -Version: 0 -Release: 0.12%{?dist} +Release: 1%{?dist} Summary: Pkcs11 wrapper for Go + +# Upstream license specification: BSD-3-Clause License: BSD URL: %{gourl} Source0: %{gosource} Source1: glide.yaml -Source2: glide.yaml - +Source2: glide.lock +# Use system library Patch0: use-system-library.patch -Patch1: 0001-update-test-env-settings.patch -Patch2: Fix-formatting.patch +Patch1: update-test-env-settings.patch -%description -%{summary} +BuildRequires: libtool-ltdl-devel +BuildRequires: softhsm -%package devel -Summary: %{summary} -BuildArch: noarch - -BuildRequires: libtool-ltdl-devel - -%description devel -%{summary} +%description +%{common_description} -This package contains library source intended for -building other packages which use import path with -%{goipath} prefix. +%gopkg %prep -%forgesetup -cp %{SOURCE1} %{SOURCE2} . +%goprep %patch0 -p1 %patch1 -p1 -%patch2 -p1 +cp %{S:1} %{S:2} . %install -%goinstall glide.lock glide.yaml +%gopkginstall +%if %{with check} %check -# Failed to init lib -%gochecks -d . +%gocheck -d . +%endif -#define license tag if not already defined -%{!?_licensedir:%global license %doc} - -%files devel -f devel.file-list -%license LICENSE -%doc README.md +%gopkgfiles %changelog -* Fri Feb 01 2019 Fedora Release Engineering - Forge-specific packaging variables +* Fri May 31 19:46:02 CEST 2019 Robert-André Mauchin - 1.0.2-1 +- Release 1.0.2 + +* Fri Feb 01 2019 Fedora Release Engineering - 0-0.12.git88c9f84 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Tue Oct 23 2018 Nicolas Mailhot -- 0-0.11 +* Tue Oct 23 2018 Nicolas Mailhot - 0-0.11.git88c9f84 - redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ -* Fri Jul 13 2018 Fedora Release Engineering - Forge-specific packaging variables +* Fri Jul 13 2018 Fedora Release Engineering - 0-0.10.git88c9f84 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sun Jul 08 2018 Jan Chaloupka - 0-0.9.git88c9f84 diff --git a/sources b/sources index e2f363c..eba7fcb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pkcs11-88c9f842544e629ec046105d7fb50d5daafae737.tar.gz) = a67aa30de43dbab4a61f5869bbb291ebe73f3db2a64f8ee2d879b44f11ddc0b0f889d9edf80a5a08a137e29c12ce238c576a520e5067cd3c074b64dd5950f399 +SHA512 (pkcs11-1.0.2.tar.gz) = d3d03564ca67a9dc78c9c24a926ff4d48010c05f3f19c57eec8242488e3564ea625c03d0793d73dad299ec9b89aff22bf8de7a9468ba34c2180e38216895e5e4 diff --git a/update-test-env-settings.patch b/update-test-env-settings.patch new file mode 100644 index 0000000..00370cb --- /dev/null +++ b/update-test-env-settings.patch @@ -0,0 +1,25 @@ +diff -up pkcs11-1.0.2/pkcs11_test.go.update_test_env pkcs11-1.0.2/pkcs11_test.go +--- pkcs11-1.0.2/pkcs11_test.go.update_test_env 2019-04-19 09:10:23.000000000 +0200 ++++ pkcs11-1.0.2/pkcs11_test.go 2019-05-31 21:24:47.972636140 +0200 +@@ -25,7 +25,7 @@ This test supports the following environ + */ + + func setenv(t *testing.T) *Ctx { +- lib := "/usr/lib/softhsm/libsofthsm.so" ++ lib := "/usr/lib64/softhsm/libsofthsm.so" + if x := os.Getenv("SOFTHSM_LIB"); x != "" { + lib = x + } +@@ -38,10 +38,9 @@ func setenv(t *testing.T) *Ctx { + } + + func TestSetenv(t *testing.T) { +- wd, _ := os.Getwd() +- os.Setenv("SOFTHSM_CONF", wd+"/softhsm.conf") ++ os.Setenv("SOFTHSM_CONF", "/etc/softhsm.conf") + +- lib := "/usr/lib/softhsm/libsofthsm.so" ++ lib := "/usr/lib64/softhsm/libsofthsm.so" + if x := os.Getenv("SOFTHSM_LIB"); x != "" { + lib = x + } diff --git a/use-system-library.patch b/use-system-library.patch index 22f0054..f1812c5 100644 --- a/use-system-library.patch +++ b/use-system-library.patch @@ -1,26 +1,13 @@ -From 2e2af4063e730ffa6e67c3e5a0b2566baa0437c2 Mon Sep 17 00:00:00 2001 -From: Jan Chaloupka -Date: Fri, 9 Oct 2015 00:18:57 +0200 -Subject: [PATCH] use system library - ---- - pkcs11.go | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pkcs11.go b/pkcs11.go -index 44023ca..ed9323d 100644 ---- a/pkcs11.go -+++ b/pkcs11.go -@@ -11,7 +11,8 @@ package pkcs11 - // * CK_ULONG never overflows an Go int +diff -up pkcs11-1.0.2/pkcs11.go.use_system_library pkcs11-1.0.2/pkcs11.go +--- pkcs11-1.0.2/pkcs11.go.use_system_library 2019-04-19 09:10:23.000000000 +0200 ++++ pkcs11-1.0.2/pkcs11.go 2019-05-31 19:52:30.838221247 +0200 +@@ -12,7 +12,8 @@ package pkcs11 /* --#cgo LDFLAGS: -lltdl -+#cgo CFLAGS: -I/usr/include -I/usr/include/libltdl -+#cgo LDFLAGS: -L/usr/lib64/ -lltdl - #define CK_PTR * - #ifndef NULL_PTR - #define NULL_PTR 0 --- -1.9.3 - + #cgo windows CFLAGS: -DPACKED_STRUCTURES +-#cgo linux LDFLAGS: -ldl ++#cgo linux CFLAGS: -I/usr/include -I/usr/include/libltdl ++#cgo linux LDFLAGS: -L/usr/lib64/ -lltdl -ldl + #cgo darwin LDFLAGS: -ldl + #cgo openbsd LDFLAGS: -ldl + #cgo freebsd LDFLAGS: -ldl