mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
new file: projects/github.com/thkukuk/libnsl/package.yml
new file: projects/github.com/thkukuk/libnsl/test.c
This commit is contained in:
parent
8c42467d03
commit
47ff78a6bd
31
projects/github.com/thkukuk/libnsl/package.yml
Normal file
31
projects/github.com/thkukuk/libnsl/package.yml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/thkukuk/libnsl/releases/download/v{{version}}/libnsl-{{version}}.tar.xz
|
||||||
|
strip-components: 1
|
||||||
|
versions:
|
||||||
|
github: thkukuk/libnsl
|
||||||
|
platforms:
|
||||||
|
- linux
|
||||||
|
dependencies:
|
||||||
|
sourceforge.net/libtirpc: '*'
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
freedesktop.org/pkg-config: '*'
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
gnu.org/make: '*'
|
||||||
|
script:
|
||||||
|
- ./configure $CONFIGURE_ARGS
|
||||||
|
- make --jobs {{ hw.concurrency }}
|
||||||
|
- make --jobs {{ hw.concurrency }} install
|
||||||
|
env:
|
||||||
|
CONFIGURE_ARGS:
|
||||||
|
- --disable-debug
|
||||||
|
- --disable-dependency-tracking
|
||||||
|
- --prefix="{{prefix}}"
|
||||||
|
- --libdir="{{prefix}}/lib"
|
||||||
|
- --disable-silent-rules
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
script:
|
||||||
|
- gcc test.c -lnsl -o test
|
||||||
|
- ./test | grep domain
|
17
projects/github.com/thkukuk/libnsl/test.c
Normal file
17
projects/github.com/thkukuk/libnsl/test.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <rpcsvc/ypclnt.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
char *domain;
|
||||||
|
switch (yp_get_default_domain(&domain)) {
|
||||||
|
case YPERR_SUCCESS:
|
||||||
|
printf("Domain: %s\n", domain);
|
||||||
|
return 0;
|
||||||
|
case YPERR_NODOM:
|
||||||
|
printf("No domain\n");
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue