{"action":"created","issue":{"url":"https://api.github.com/repos/barak/nbibtex/issues/1","labels_url":"https://api.github.com/repos/barak/nbibtex/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/barak/nbibtex/issues/1/comments","events_url":"https://api.github.com/repos/barak/nbibtex/issues/1/events","html_url":"https://github.com/barak/nbibtex/pull/1","id":65710179,"number":1,"title":"nbibtex binary to open the 'os' package","user":{"login":"nrnrnr","id":37659,"avatar_url":"https://avatars.githubusercontent.com/u/37659?v=3","gravatar_id":"","url":"https://api.github.com/users/nrnrnr","html_url":"https://github.com/nrnrnr","followers_url":"https://api.github.com/users/nrnrnr/followers","following_url":"https://api.github.com/users/nrnrnr/following{/other_user}","gists_url":"https://api.github.com/users/nrnrnr/gists{/gist_id}","starred_url":"https://api.github.com/users/nrnrnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrnrnr/subscriptions","organizations_url":"https://api.github.com/users/nrnrnr/orgs","repos_url":"https://api.github.com/users/nrnrnr/repos","events_url":"https://api.github.com/users/nrnrnr/events{/privacy}","received_events_url":"https://api.github.com/users/nrnrnr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-01T15:19:08Z","updated_at":"2015-04-10T10:25:42Z","closed_at":"2015-04-01T19:02:47Z","pull_request":{"url":"https://api.github.com/repos/barak/nbibtex/pulls/1","html_url":"https://github.com/barak/nbibtex/pull/1","diff_url":"https://github.com/barak/nbibtex/pull/1.diff","patch_url":"https://github.com/barak/nbibtex/pull/1.patch"},"body":"This fix solves the immediate problem that after the `nbibtex` binary is built, it fails on startup.\r\n"},"comment":{"url":"https://api.github.com/repos/barak/nbibtex/issues/comments/91508180","html_url":"https://github.com/barak/nbibtex/pull/1#issuecomment-91508180","issue_url":"https://api.github.com/repos/barak/nbibtex/issues/1","id":91508180,"user":{"login":"barak","id":41826,"avatar_url":"https://avatars.githubusercontent.com/u/41826?v=3","gravatar_id":"","url":"https://api.github.com/users/barak","html_url":"https://github.com/barak","followers_url":"https://api.github.com/users/barak/followers","following_url":"https://api.github.com/users/barak/following{/other_user}","gists_url":"https://api.github.com/users/barak/gists{/gist_id}","starred_url":"https://api.github.com/users/barak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barak/subscriptions","organizations_url":"https://api.github.com/users/barak/orgs","repos_url":"https://api.github.com/users/barak/repos","events_url":"https://api.github.com/users/barak/events{/privacy}","received_events_url":"https://api.github.com/users/barak/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T10:25:42Z","updated_at":"2015-04-10T10:25:42Z","body":"> Is there a Debian standard way to discover ```${ARCH}``` in my ```configure``` script?\r\n\r\nBecause you might be in a cross-compilation situation, you want the \"host\" architecture, rather than the \"build\" or \"target\" architectures. (There are three because you might be compiling a compiler on BUILD which will run on HOST and generate executables for TARGET, and all three of these might have different architectures.)\r\n\r\nYou could get it from\r\n````\r\n$ dpkg-architecture -qDEB_HOST_GNU_TYPE\r\nx86_64-linux-gnu\r\n````\r\nDuring the build, the base directory you want is passed in option ```--libdir```\r\n````\r\n$ debian/rules build\r\ndh build --parallel\r\n   dh_testdir -O--parallel\r\n   dh_auto_configure -O--parallel\r\nwarning: Unknown option --build=x86_64-linux-gnu\r\nwarning: Unknown option --includedir=${prefix}/include\r\nwarning: Unknown option --infodir=${prefix}/share/info\r\nwarning: Unknown option --sysconfdir=/etc\r\nwarning: Unknown option --localstatedir=/var\r\nwarning: Unknown option --libdir=${prefix}/lib/x86_64-linux-gnu\r\nwarning: Unknown option --libexecdir=${prefix}/lib/x86_64-linux-gnu\r\nwarning: Unknown option --disable-maintainer-mode\r\nwarning: Unknown option --disable-dependency-tracking\r\n````\r\nso it would make sense to parse that out and let it take precedence.\r\n\r\nIf you want something that will work on non-Debian-derived systems, you can use the ```autotools``` mechanism yourself,\r\n````\r\n$ /usr/share/misc/config.guess | sed s:-unknown-:-:\r\nx86_64-linux-gnu\r\n````\r\neven though, technically speaking, this gives you the \"build\" architecture rather than the \"host\" architecture.\r\n\r\nYou could try to piece it together from the output of ```uname``` but if you try to do this robustly you'll find there's a reason that\r\n````\r\n$ wc -l /usr/share/misc/config.*\r\n 1420 /usr/share/misc/config.guess\r\n 1799 /usr/share/misc/config.sub\r\n 3219 total\r\n````\r\nTLDR: lots of ways all a bit ugly."}}