pkg_noisrev 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,137 @@
1
+ # New ports collection makefile for: xorg-server
2
+ # Date created: 7 May 2004
3
+ # Whom: anholt@FreeBSD.org
4
+ #
5
+ # $FreeBSD: ports/x11-servers/xorg-server/Makefile,v 1.80 2011/02/27 23:16:09 naddy Exp $
6
+ #
7
+
8
+ PORTNAME= xorg-server
9
+ PORTVERSION= 1.7.7
10
+ PORTREVISION= 1
11
+ PORTEPOCH= 1
12
+ CATEGORIES= x11-servers
13
+ MASTER_SITES= http://xorg.freedesktop.org/releases/individual/xserver/
14
+ DISTFILES= xorg-server-${PORTVERSION}.tar.bz2
15
+
16
+ MAINTAINER= x11@FreeBSD.org
17
+ COMMENT= X.Org X server and related programs
18
+
19
+ LIB_DEPENDS= drm:${PORTSDIR}/graphics/libdrm
20
+
21
+ RUN_DEPENDS= ${LOCALBASE}/share/X11/xkb/rules/base.xml:${PORTSDIR}/x11/xkeyboard-config
22
+
23
+ XORG_CAT= xserver
24
+
25
+ USE_GMAKE= yes
26
+ USE_GL= gl
27
+ USE_XORG= xf86driproto glproto xdmcp x11 xkbfile xxf86misc xxf86vm xaw7 \
28
+ xmu xt xpm xext randrproto renderproto fixesproto damageproto \
29
+ dri2proto xcmiscproto xextproto xproto xtrans xf86miscproto \
30
+ xf86vidmodeproto xf86bigfontproto scrnsaverproto bigreqsproto \
31
+ resourceproto fontsproto inputproto xf86dgaproto \
32
+ videoproto compositeproto trapproto recordproto xineramaproto \
33
+ xinerama evieproto xfont fontenc xkbui pixman pciaccess
34
+
35
+ MAKE_JOBS_UNSAFE= yes
36
+ USE_OPENSSL= yes
37
+ USE_PERL5_BUILD=yes
38
+ CONFIGURE_ARGS= --disable-dmx --disable-xvfb --disable-xnest \
39
+ --localstatedir=/var --without-dtrace --disable-xephyr \
40
+ --enable-record=yes
41
+
42
+ MAN1= Xorg.1 \
43
+ Xserver.1 \
44
+ cvt.1 \
45
+ gtf.1
46
+ MAN4= exa.4 \
47
+ fbdevhw.4
48
+ MAN5= xorg.conf.5
49
+
50
+ NOT_FOR_ARCHS= alpha
51
+
52
+ .if !defined(ARCH)
53
+ ARCH!= /usr/bin/uname -p
54
+ .endif
55
+
56
+ OPTIONS= AIGLX "Compile with Accelerated Indirect GLX support" on \
57
+ SUID "Install the Xorg server with setuid bit set" on
58
+ .if ${ARCH} == sparc64
59
+ OPTIONS+= HAL "Compile with HAL config support" off
60
+ .else
61
+ OPTIONS+= HAL "Compile with HAL config support" on
62
+ .endif
63
+
64
+ .include <bsd.port.pre.mk>
65
+
66
+ .if defined(WITH_OPENSSL_BASE)
67
+ # The reason why I use this is cause openssl from base doesn't install a .pc file
68
+ # and configure will fail trying to find it. Setting both of those variables to
69
+ # a *non-empty* value by-passes the pkg-config check.
70
+ CONFIGURE_ENV= SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
71
+ .endif
72
+
73
+ .if !defined(WITHOUT_HAL)
74
+ LIB_DEPENDS+= hal.1:${PORTSDIR}/sysutils/hal
75
+ CONFIGURE_ARGS+= --enable-config-hal=yes
76
+ .else
77
+ CONFIGURE_ARGS+= --enable-config-hal=no
78
+ .endif
79
+
80
+ .if !defined(WITHOUT_AIGLX)
81
+ CONFIGURE_ARGS+= --enable-aiglx=yes
82
+ .else
83
+ CONFIGURE_ARGS+= --enable-aiglx=no
84
+ .endif
85
+
86
+ .if !defined(WITHOUT_SUID) && (!defined(NO_SUID_XSERVER) || ${NO_SUID_XSERVER} == NO)
87
+ CONFIGURE_ARGS+=--enable-install-setuid=yes
88
+ .else
89
+ CONFIGURE_ARGS+=--enable-install-setuid=no
90
+ .endif
91
+
92
+ .if ${ARCH} == alpha
93
+ PLIST_SUB+= ALPHA_NA="@comment "
94
+ EXTRA_PATCHES= ${.CURDIR}/files/extra-arch-alpha
95
+ .else
96
+ PLIST_SUB+= ALPHA_NA=""
97
+ .endif
98
+
99
+ .if ${ARCH} == ia64
100
+ PLIST_SUB+= IA64_NA="@comment "
101
+ EXTRA_PATCHES= ${.CURDIR}/files/extra-arch-ia64
102
+ .else
103
+ PLIST_SUB+= IA64_NA=""
104
+ .endif
105
+
106
+ .if ${ARCH} == powerpc || ${ARCH} == powerpc64
107
+ PLIST_SUB+= PPC_NA="@comment "
108
+ EXTRA_PATCHES= ${.CURDIR}/files/extra-arch-powerpc
109
+ .else
110
+ PLIST_SUB+= PPC_NA=""
111
+ .endif
112
+
113
+ .if ${ARCH} == sparc64
114
+ PLIST_SUB+= SPARC64=""
115
+ PLIST_SUB+= SPARC64_NA="@comment "
116
+ .else
117
+ PLIST_SUB+= SPARC64="@comment "
118
+ PLIST_SUB+= SPARC64_NA=""
119
+ .endif
120
+
121
+ .if ${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == sparc64
122
+ PLIST_SUB+= AMD64_I386_SPARC64=""
123
+ .else
124
+ PLIST_SUB+= AMD64_I386_SPARC64="@comment "
125
+ .endif
126
+
127
+ .if !defined(WITHOUT_SUID) && (!defined(NO_SUID_XSERVER) || ${NO_SUID_XSERVER} == NO)
128
+ pre-everything::
129
+ @${ECHO_MSG} "By default, the X Server installs as a set-user-id root binary. When run by"
130
+ @${ECHO_MSG} "a normal user, it checks arguments and environment as done in the x11/wrapper"
131
+ @${ECHO_MSG} "port before handling them normally. If you are concerned about the security"
132
+ @${ECHO_MSG} "of this, but still want to run an X Server (for example using xdm/kdm/gdm,"
133
+ @${ECHO_MSG} "which will still run the server as root), you can cancel the build and set"
134
+ @${ECHO_MSG} "NO_SUID_XSERVER=YES in /etc/make.conf."
135
+ .endif
136
+
137
+ .include <bsd.port.post.mk>
@@ -0,0 +1,70 @@
1
+ require_relative 'helper'
2
+
3
+ require_relative '../lib/pkg_noisrev/fbsdpackage.rb'
4
+
5
+ class TestFbsdPackage < MiniTest::Unit::TestCase
6
+ def setup
7
+ # this runs every time before test_*
8
+ @cmd = cmd('pkg_noisrev') # get path to the exe & cd to tests directory
9
+ end
10
+
11
+ def test_origin
12
+ assert_equal(FbsdPackage.origin(PKG_DIR, 'zip-3.0'),
13
+ ['archivers/zip', 1])
14
+ assert_raises(Errno::ENOENT) { FbsdPackage.origin(PKG_DIR, 'notexists') }
15
+ assert_equal(FbsdPackage.origin(PKG_DIR, 'xmbdfed-4.7.1_2'),
16
+ ['x11-fonts/xmbdfed', 3])
17
+ assert_equal(FbsdPackage.origin(PKG_DIR, 'invalid-1.0'),
18
+ [nil, 0])
19
+ end
20
+
21
+ def test_parse_name
22
+ assert_equal(FbsdPackage.parse_name("foo-bar-4.7.1_2"), ['foo-bar', '4.7.1_2'])
23
+ assert_equal(FbsdPackage.parse_name(" "), [' ', '0'])
24
+ end
25
+
26
+ def test_dir_collect
27
+ assert_match(assert_raises(RuntimeError) {
28
+ FbsdPackage.dir_collect "#{PKG_DIR}/zip-3.0"
29
+ }.message, /no package records in/)
30
+
31
+ q = Queue.new
32
+ q.push 'ports'
33
+ q.push 'package'
34
+ r = FbsdPackage.dir_collect PKG_DIR.parent
35
+ 2.times { assert_equal(r.pop, q.pop) }
36
+ end
37
+
38
+ def test_execution_default
39
+ #
40
+ r = Trestle.cmd_run("#{@cmd} --pkg-dir #{PKG_DIR} --ports-dir #{PORTS_DIR}")
41
+ # pp r[2].split("\n")
42
+ assert_equal(0, r[0])
43
+ assert_match(/^100% 3\/1\/2 .+\/0$/, r[2])
44
+ assert_match(/^\s*1.0 \?\s*invalid$/, r[2])
45
+ assert_match(/^\s*4.7.1_2 \?\s*xmbdfed$/, r[2])
46
+ assert_match(/^\s*3.0 = 3.0\s*zip$/, r[2])
47
+ end
48
+
49
+ def test_execution_likeportmaster
50
+ # bin/pkg_noisrev --pkg-dir test/semis/package --ports-dir test/semis/ports --likeportmaster | egrep '^(\*|[ a-z])' | md5
51
+ r = Trestle.cmd_run("#{@cmd} --pkg-dir #{PKG_DIR} --ports-dir #{PORTS_DIR} --likeportmaster | egrep '^(\\*|[ a-z])' ")
52
+ assert_equal(0, r[0])
53
+ assert_equal(Digest::MD5.hexdigest(r[2]), '621543e28ce56b1bfe9c1ba074451364')
54
+ end
55
+
56
+ def test_execution_with_bogus_pkg_dir
57
+ # bin/pkg_noisrev --pkg-dir test/semis --ports-dir test/semis/ports --likeportmaster | egrep '^(\*|[ a-z])' | md5
58
+ r = Trestle.cmd_run("#{@cmd} --pkg-dir #{PKG_DIR.parent} --ports-dir #{PORTS_DIR} --likeportmaster | egrep '^(\\*|[ a-z])' ")
59
+ assert_equal(0, r[0])
60
+ assert_equal(Digest::MD5.hexdigest(r[2]), 'db0f7e1a3d9d9b07f656acd63222339e')
61
+ end
62
+
63
+ def test_execution_outofsync
64
+ # bin/pkg_noisrev --pkg-dir test/semis/package --ports-dir test/semis/ports --outofsync | egrep '^(\*|[ a-z])' | md5
65
+ r = Trestle.cmd_run("#{@cmd} --pkg-dir #{PKG_DIR} --ports-dir #{PORTS_DIR} --outofsync | egrep '^(\\*|[ a-z])' ")
66
+ assert_equal(0, r[0])
67
+ assert_equal(Digest::MD5.hexdigest(r[2]), '1245866b4edeba20373357902ca72cb8')
68
+ end
69
+
70
+ end
@@ -0,0 +1,42 @@
1
+ require_relative 'helper'
2
+
3
+ require_relative '../lib/pkg_noisrev/fbsdpackage.rb'
4
+
5
+ class TestFbsdPorts < MiniTest::Unit::TestCase
6
+ def setup
7
+ # this runs every time before test_*
8
+ @cmd = cmd('pkg_noisrev') # get path to the exe & cd to tests directory
9
+ end
10
+
11
+ def test_version_dll
12
+ assert_equal(FbsdPackageVersion.version_cmp('1.1', '1.2'), -1)
13
+ assert_equal(FbsdPackageVersion.version_cmp('2.2.2', '2.2.2'), 0)
14
+ assert_equal(FbsdPackageVersion.version_cmp('2.2', '2.1'), 1)
15
+ end
16
+
17
+ def test_external_make
18
+ assert_equal(FbsdPort.ver_slow(PORTS_DIR.to_s, "x11-servers/xorg-server"),
19
+ "1.7.7_1,1")
20
+ assert_raises(Errno::ENOENT) {
21
+ FbsdPort.ver_slow(PORTS_DIR.to_s, "some/dir")
22
+ }
23
+ end
24
+
25
+ def test_ver
26
+ assert_equal(FbsdPort.ver(PORTS_DIR.to_s, "x11-servers/xorg-server"),
27
+ "1.7.7_1,1")
28
+ assert_match(assert_raises(RuntimeError) {
29
+ FbsdPort.ver(PORTS_DIR.to_s, "some/dir")
30
+ }.message, /\(rlevel=0\) No such file or directory/)
31
+ end
32
+
33
+ def test_moved
34
+ r = FbsdPort.moved PORTS_DIR.to_s
35
+ assert_equal(r.size, 7)
36
+ assert_equal(r['science/bblimage'].date, '2011-07-28')
37
+
38
+ out, err = capture_io { FbsdPort.moved 'some/dir' }
39
+ assert_match(/parsing .+\/MOVED failed: No such file/, err)
40
+ end
41
+
42
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pkg_noisrev
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Alexander Gromnitsky
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-08-04 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: open4
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.1.0
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: git
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 1.2.5
35
+ type: :development
36
+ version_requirements: *id002
37
+ description: A fast way to summarize installed versions of FreeBSD packages.
38
+ email: alexander.gromnitsky@gmail.com
39
+ executables:
40
+ - pkg_noisrev
41
+ extensions:
42
+ - ext/extconf.rb
43
+ extra_rdoc_files:
44
+ - doc/LICENSE
45
+ - doc/NEWS.rdoc
46
+ - doc/README.rdoc
47
+ - doc/TODO
48
+ files:
49
+ - Gemfile
50
+ - README.rdoc
51
+ - Rakefile
52
+ - bin/pkg_noisrev
53
+ - doc/LICENSE
54
+ - doc/NEWS.rdoc
55
+ - doc/README.rdoc
56
+ - doc/TODO
57
+ - etc/pkg_noisrev.yaml
58
+ - ext/extconf.rb
59
+ - ext/rakefile.rb
60
+ - ext/version.c
61
+ - ext/version.h
62
+ - lib/pkg_noisrev/fbsdpackage.rb
63
+ - lib/pkg_noisrev/fbsdpackageversion.rb
64
+ - lib/pkg_noisrev/meta.rb
65
+ - lib/pkg_noisrev/threads.rb
66
+ - lib/pkg_noisrev/trestle.rb
67
+ - test/helper.rb
68
+ - test/helper_trestle.rb
69
+ - test/rake_git.rb
70
+ - test/semis/package/invalid-1.0/+CONTENTS
71
+ - test/semis/package/xmbdfed-4.7.1_2/+COMMENT
72
+ - test/semis/package/xmbdfed-4.7.1_2/+CONTENTS
73
+ - test/semis/package/zip-3.0/+COMMENT
74
+ - test/semis/package/zip-3.0/+CONTENTS
75
+ - test/semis/package/zip-3.0/+REQUIRED_BY
76
+ - test/semis/ports/MOVED
77
+ - test/semis/ports/archivers/zip/Makefile
78
+ - test/semis/ports/x11-servers/xorg-server/Makefile
79
+ - test/test_fbsdpackages.rb
80
+ - test/test_fbsdports.rb
81
+ homepage: http://github.com/gromnitsky/pkg_noisrev
82
+ licenses: []
83
+
84
+ post_install_message:
85
+ rdoc_options:
86
+ - -m
87
+ - doc/README.rdoc
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 1.9.2
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: "0"
102
+ requirements: []
103
+
104
+ rubyforge_project:
105
+ rubygems_version: 1.8.5
106
+ signing_key:
107
+ specification_version: 3
108
+ summary: A fast way to summarize installed versions of FreeBSD packages
109
+ test_files:
110
+ - test/test_fbsdports.rb
111
+ - test/test_fbsdpackages.rb