heistp / irtt

Isochronous Round-Trip Tester
GNU General Public License v2.0
185 stars 23 forks source link

Creating an RPM .spec file #19

Closed tohojo closed 2 years ago

tohojo commented 5 years ago

I'm working on getting Flent into Fedora, but need to package up irtt as a requirement first (see https://bugzilla.redhat.com/show_bug.cgi?id=1729939).

The initial automated .spec file fails because you're using ogier/pflag instead of spf13/pflag (the latter is already packaged for Fedora). Any particular reason for this choice?

See https://koji.fedoraproject.org/koji/taskinfo?taskID=36285784 for build log...

heistp commented 5 years ago

Yes, because I was trying to keep the binary as small as possible and ogier/pflag was smaller and had the features I needed. Just tested it now and it's a two-liner to replace the imports with spf13 but adds 124K to the (minimized) binary. All I want is normal long form options with -- and not -. :)

If that's causing a hassle and there's no way you can just import a package (?) I suppose I could take the 124K hit.

tohojo commented 5 years ago

Pete Heist notifications@github.com writes:

Yes, because I was trying to keep the binary as small as possible and ogier/pflag was smaller and had the features I needed. Just tested it now and it's a two-liner to replace the imports with spf13 but adds 124K to the (minimized) binary. All I want is normal long form options with -- and not -. :)

If that's causing a hassle and there's no way you can just import a package (?) I suppose I could take the 124K hit.

I doubt I'll get much traction for carrying both packages. If they're compatible, I could just patch the source from the .spec file - it's basically just 'sed -i s/ogier/spf13/ *.go', right?

heistp commented 5 years ago

Yes, they're compatible. To be on the safe side replace ogier/pflag with spf13/pflag. For now it's only in irtt_client.go and irtt_server.go, although *.go is probably better in case names change. That would be nice if you could patch it that way.

tohojo commented 5 years ago

Pete Heist notifications@github.com writes:

Yes, they're compatible. To be on the safe side replace ogier/pflag with spf13/pflag. For now it's only in irtt_client.go and irtt_server.go, although *.go is probably better in case names change. That would be nice if you could patch it that way.

Well, I'd probably create a proper .patch file - but cool, let's see if we can't solve it that way :)

heistp commented 5 years ago

Ok, so in case this unified diff helps...

% git diff irtt_client.go irtt_server.go 
diff --git a/irtt_client.go b/irtt_client.go
index 38f2d21..c8d2cd3 100644
--- a/irtt_client.go
+++ b/irtt_client.go
@@ -14,7 +14,7 @@ import (
        "text/tabwriter"
        "time"

-       flag "github.com/ogier/pflag"
+       flag "github.com/spf13/pflag"
 )

 func clientUsage() {
diff --git a/irtt_server.go b/irtt_server.go
index 6bdc0da..98ae5e9 100644
--- a/irtt_server.go
+++ b/irtt_server.go
@@ -6,7 +6,7 @@ import (
        "strings"
        "syscall"

-       flag "github.com/ogier/pflag"
+       flag "github.com/spf13/pflag"
 )

 func serverUsage() {
tohojo commented 5 years ago

Pete Heist notifications@github.com writes:

Ok, so in case this unified diff helps...

Great, thanks!

tohojo commented 2 years ago

Finally got around to packaing irtt for Fedora: https://src.fedoraproject.org/rpms/golang-github-heistp-irtt

So closing this issue :)

heistp commented 2 years ago

Great, thanks!